mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +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");
|
||||
|
||||
ToolTipInfo info;
|
||||
|
||||
if (type == "")
|
||||
{
|
||||
mDynamicToolTipBox->setVisible(false);
|
||||
|
@ -61,7 +60,7 @@ void ToolTips::onFrame(float frameDuration)
|
|||
}
|
||||
else if (type == "Text")
|
||||
{
|
||||
info.caption = text;
|
||||
info.text = text;
|
||||
}
|
||||
else if (type == "CaptionText")
|
||||
{
|
||||
|
@ -197,8 +196,8 @@ IntSize ToolTips::createToolTip(const ToolTipInfo& info)
|
|||
|
||||
const IntPoint padding(8, 8);
|
||||
|
||||
const int imageCaptionHPadding = 8;
|
||||
const int imageCaptionVPadding = 4;
|
||||
const int imageCaptionHPadding = (caption != "" ? 8 : 0);
|
||||
const int imageCaptionVPadding = (caption != "" ? 4 : 0);
|
||||
|
||||
std::string realImage = "icons\\" + image;
|
||||
findImageExtension(realImage);
|
||||
|
@ -208,7 +207,7 @@ IntSize ToolTips::createToolTip(const ToolTipInfo& info)
|
|||
captionWidget->setCaption(caption);
|
||||
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");
|
||||
textWidget->setProperty("Static", "true");
|
||||
|
|
Loading…
Reference in a new issue