From d4678a8d5517a8d897c64151eba63f2a02c2bd45 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 17 Jun 2014 18:33:53 +0200 Subject: [PATCH] Fix level up dialogue layout (Fixes #1393) --- apps/openmw/mwgui/levelupdialog.cpp | 5 +++-- apps/openmw/mwgui/tooltips.cpp | 8 ++------ apps/openmw/mwgui/widgets.cpp | 7 +++++-- files/mygui/openmw_levelup_dialog.layout | 24 ++++++++++++++++-------- files/mygui/openmw_text.skin.xml | 7 +++++++ 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp index 38995ac32..eaa822722 100644 --- a/apps/openmw/mwgui/levelupdialog.cpp +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -104,9 +104,10 @@ namespace MWGui int attribute = mSpentAttributes[i]; - int xdiff = mAttributeMultipliers[attribute]->getCaption() == "" ? 0 : 30; + int xdiff = mAttributeMultipliers[attribute]->getCaption() == "" ? 0 : 20; - MyGUI::IntPoint pos = mAttributes[attribute]->getAbsolutePosition() - mMainWidget->getAbsolutePosition() - MyGUI::IntPoint(24+xdiff,-4); + MyGUI::IntPoint pos = mAttributes[attribute]->getAbsolutePosition() - mMainWidget->getAbsolutePosition() - MyGUI::IntPoint(22+xdiff,0); + pos.top += (mAttributes[attribute]->getHeight() - image->getHeight())/2; image->setPosition(pos); } diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 16b010908..676a9ee63 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -233,13 +233,9 @@ namespace MWGui for (std::map::iterator it = userStrings.begin(); it != userStrings.end(); ++it) { - if (it->first == "ToolTipType" - || it->first == "ToolTipLayout" - || it->first == "IsMarker") - continue; - - size_t underscorePos = it->first.find("_"); + if (underscorePos == std::string::npos) + continue; std::string propertyKey = it->first.substr(0, underscorePos); std::string widgetName = it->first.substr(underscorePos+1, it->first.size()-(underscorePos+1)); diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index b30cf2bae..b83ca0b09 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -630,8 +630,11 @@ namespace MWGui MyGUI::IntSize AutoSizedButton::getRequestedSize() { - MyGUI::IntSize size = getTextSize() + MyGUI::IntSize(24,0); - size.height = std::max(24, size.height); + MyGUI::IntSize padding(24, 8); + if (isUserString("TextPadding")) + padding = MyGUI::IntSize::parse(getUserString("TextPadding")); + + MyGUI::IntSize size = getTextSize() + MyGUI::IntSize(padding.width,padding.height); return size; } diff --git a/files/mygui/openmw_levelup_dialog.layout b/files/mygui/openmw_levelup_dialog.layout index 765bf88a8..0b12d7a05 100644 --- a/files/mygui/openmw_levelup_dialog.layout +++ b/files/mygui/openmw_levelup_dialog.layout @@ -31,17 +31,18 @@ - - - - - - - - + + + + + + + + + @@ -55,6 +56,7 @@ + @@ -68,6 +70,7 @@ + @@ -81,6 +84,7 @@ + @@ -95,6 +99,7 @@ + @@ -108,6 +113,7 @@ + @@ -121,6 +127,7 @@ + @@ -134,6 +141,7 @@ + diff --git a/files/mygui/openmw_text.skin.xml b/files/mygui/openmw_text.skin.xml index d4c72c75b..4c1117cf5 100644 --- a/files/mygui/openmw_text.skin.xml +++ b/files/mygui/openmw_text.skin.xml @@ -32,6 +32,13 @@ + + + + + + +