mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 12:53:52 +00:00
some formatting tweaks
This commit is contained in:
parent
48e3c43823
commit
bd132074af
1 changed files with 4 additions and 5 deletions
|
@ -53,7 +53,6 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
std::string text = focus->getUserString("ToolTipText");
|
std::string text = focus->getUserString("ToolTipText");
|
||||||
|
|
||||||
ToolTipInfo info;
|
ToolTipInfo info;
|
||||||
|
|
||||||
if (type == "")
|
if (type == "")
|
||||||
{
|
{
|
||||||
mDynamicToolTipBox->setVisible(false);
|
mDynamicToolTipBox->setVisible(false);
|
||||||
|
@ -61,7 +60,7 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
}
|
}
|
||||||
else if (type == "Text")
|
else if (type == "Text")
|
||||||
{
|
{
|
||||||
info.caption = text;
|
info.text = text;
|
||||||
}
|
}
|
||||||
else if (type == "CaptionText")
|
else if (type == "CaptionText")
|
||||||
{
|
{
|
||||||
|
@ -197,8 +196,8 @@ IntSize ToolTips::createToolTip(const ToolTipInfo& info)
|
||||||
|
|
||||||
const IntPoint padding(8, 8);
|
const IntPoint padding(8, 8);
|
||||||
|
|
||||||
const int imageCaptionHPadding = 8;
|
const int imageCaptionHPadding = (caption != "" ? 8 : 0);
|
||||||
const int imageCaptionVPadding = 4;
|
const int imageCaptionVPadding = (caption != "" ? 4 : 0);
|
||||||
|
|
||||||
std::string realImage = "icons\\" + image;
|
std::string realImage = "icons\\" + image;
|
||||||
findImageExtension(realImage);
|
findImageExtension(realImage);
|
||||||
|
@ -208,7 +207,7 @@ IntSize ToolTips::createToolTip(const ToolTipInfo& info)
|
||||||
captionWidget->setCaption(caption);
|
captionWidget->setCaption(caption);
|
||||||
IntSize captionSize = captionWidget->getTextSize();
|
IntSize captionSize = captionWidget->getTextSize();
|
||||||
|
|
||||||
int captionHeight = std::max(captionSize.height, imageSize);
|
int captionHeight = std::max(caption != "" ? captionSize.height : 0, imageSize);
|
||||||
|
|
||||||
EditBox* textWidget = mDynamicToolTipBox->createWidget<EditBox>("SandText", IntCoord(0, captionHeight+imageCaptionVPadding, 300, 300-captionHeight-imageCaptionVPadding), Align::Stretch, "ToolTipText");
|
EditBox* textWidget = mDynamicToolTipBox->createWidget<EditBox>("SandText", IntCoord(0, captionHeight+imageCaptionVPadding, 300, 300-captionHeight-imageCaptionVPadding), Align::Stretch, "ToolTipText");
|
||||||
textWidget->setProperty("Static", "true");
|
textWidget->setProperty("Static", "true");
|
||||||
|
|
Loading…
Reference in a new issue