From c2706ac3e7e6e040693827b042c1547b7ee7fb04 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 23 Apr 2017 09:14:32 +0400 Subject: [PATCH] Merchant repair and travel window scroll fix --- apps/openmw/mwgui/merchantrepair.cpp | 7 ++++--- apps/openmw/mwgui/merchantrepair.hpp | 1 + apps/openmw/mwgui/travelwindow.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/merchantrepair.cpp b/apps/openmw/mwgui/merchantrepair.cpp index c4639d602..f3a3e94ed 100644 --- a/apps/openmw/mwgui/merchantrepair.cpp +++ b/apps/openmw/mwgui/merchantrepair.cpp @@ -21,6 +21,7 @@ namespace MWGui { +const int MerchantRepair::sLineHeight = 18; MerchantRepair::MerchantRepair() : WindowBase("openmw_merchantrepair.layout") @@ -79,16 +80,16 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor) 0, currentY, 0, - 18, + sLineHeight, MyGUI::Align::Default ); - currentY += 18; + currentY += sLineHeight; button->setUserString("Price", MyGUI::utility::toString(price)); button->setUserData(MWWorld::Ptr(*iter)); button->setCaptionWithReplacing(name); - button->setSize(button->getTextSize().width,18); + button->setSize(mList->getWidth(),sLineHeight); button->eventMouseWheel += MyGUI::newDelegate(this, &MerchantRepair::onMouseWheel); button->setUserString("ToolTipType", "ItemPtr"); button->eventMouseButtonClick += MyGUI::newDelegate(this, &MerchantRepair::onRepairButtonClick); diff --git a/apps/openmw/mwgui/merchantrepair.hpp b/apps/openmw/mwgui/merchantrepair.hpp index 231d11089..8dcdfee12 100644 --- a/apps/openmw/mwgui/merchantrepair.hpp +++ b/apps/openmw/mwgui/merchantrepair.hpp @@ -30,6 +30,7 @@ protected: void onRepairButtonClick(MyGUI::Widget* sender); void onOkButtonClick(MyGUI::Widget* sender); + static const int sLineHeight; }; } diff --git a/apps/openmw/mwgui/travelwindow.cpp b/apps/openmw/mwgui/travelwindow.cpp index 90d3f857a..59d139e20 100644 --- a/apps/openmw/mwgui/travelwindow.cpp +++ b/apps/openmw/mwgui/travelwindow.cpp @@ -94,7 +94,7 @@ namespace MWGui toAdd->setUserString("price",oss.str()); toAdd->setCaptionWithReplacing("#{sCell=" + name + "} - " + MyGUI::utility::toString(price)+"#{sgp}"); - toAdd->setSize(toAdd->getTextSize().width,sLineHeight); + toAdd->setSize(mDestinationsView->getWidth(),sLineHeight); toAdd->eventMouseWheel += MyGUI::newDelegate(this, &TravelWindow::onMouseWheel); toAdd->setUserString("Destination", name); toAdd->setUserData(pos);