From f3aebf22ddb6e07ce94a14d7c25c71a613f600e4 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 25 Sep 2022 11:22:17 +0400 Subject: [PATCH 1/2] Improve item count handling --- apps/openmw/mwgui/itemwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/itemwidget.cpp b/apps/openmw/mwgui/itemwidget.cpp index a5658cb5d9..e9c40a7318 100644 --- a/apps/openmw/mwgui/itemwidget.cpp +++ b/apps/openmw/mwgui/itemwidget.cpp @@ -30,11 +30,11 @@ namespace { if (count > 999999999) return MyGUI::utility::toString(count/1000000000) + "b"; - else if (count > 9999999) + else if (count > 99999999) return ">9m"; else if (count > 999999) return MyGUI::utility::toString(count/1000000) + "m"; - else if (count > 9999) + else if (count > 99999) return ">9k"; else if (count > 999) return MyGUI::utility::toString(count/1000) + "k"; From 3f72432c9ff996871f1452335e6bd09d1c62ae8a Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 25 Sep 2022 11:23:03 +0400 Subject: [PATCH 2/2] Make count input box larger to fit larger text --- apps/openmw/mwgui/countdialog.cpp | 2 +- files/data/mygui/openmw_count_window.layout | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/countdialog.cpp b/apps/openmw/mwgui/countdialog.cpp index baf3a43abd..0094b166f5 100644 --- a/apps/openmw/mwgui/countdialog.cpp +++ b/apps/openmw/mwgui/countdialog.cpp @@ -40,7 +40,7 @@ namespace MWGui mSlider->setScrollRange(maxCount); mItemText->setCaption(item); - int width = std::max(mItemText->getTextSize().width + 128, 320); + int width = std::max(mItemText->getTextSize().width + 160, 320); setCoord(viewSize.width/2 - width/2, viewSize.height/2 - mMainWidget->getHeight()/2, width, diff --git a/files/data/mygui/openmw_count_window.layout b/files/data/mygui/openmw_count_window.layout index c9e160cbb2..3f1729f56d 100644 --- a/files/data/mygui/openmw_count_window.layout +++ b/files/data/mygui/openmw_count_window.layout @@ -5,10 +5,10 @@ - + - +