From 2404fc330db8a941e777809840dd51197d5c12cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 23 Oct 2025 15:43:08 +0200 Subject: [PATCH] In vertical mode, replace the mainscreen buttons with image buttons --- Common/UI/View.cpp | 4 ++-- Common/UI/View.h | 3 +++ UI/MainScreen.cpp | 25 +++++++++++++------------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Common/UI/View.cpp b/Common/UI/View.cpp index fd4da98669..8a8bf00291 100644 --- a/Common/UI/View.cpp +++ b/Common/UI/View.cpp @@ -470,8 +470,8 @@ void Choice::GetContentDimensionsBySpec(const UIContext &dc, MeasureSpec horiz, float totalH = 0.0f; if (image_.isValid()) { dc.Draw()->GetAtlas()->measureImage(image_, &w, &h); - totalW = w + 6; - totalH = h; + totalW = w * imgScale_ + 6; + totalH = h * imgScale_; } if (!text_.empty()) { const int paddingX = 12; diff --git a/Common/UI/View.h b/Common/UI/View.h index 22c429d9eb..d2e7c0aa6d 100644 --- a/Common/UI/View.h +++ b/Common/UI/View.h @@ -751,6 +751,9 @@ public: void SetShine(bool shine) { shine_ = true; } + void SetImageScale(float scale) { + imgScale_ = scale; + } protected: void ClickInternal() override; diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 20dfb2b049..315c868845 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -1273,22 +1273,23 @@ void MainScreen::CreateViews() { } if (System_GetPropertyBool(SYSPROP_HAS_FILE_BROWSER)) { - rightColumnChoices->Add(new Choice(mm->T("Load", "Load...")))->OnClick.Handle(this, &MainScreen::OnLoadFile); + rightColumnChoices->Add(vertical ? new Choice(ImageID("I_FOLDER_OPEN")) : new Choice(mm->T("Load", "Load...")))->OnClick.Handle(this, &MainScreen::OnLoadFile); } - rightColumnChoices->Add(new Choice(mm->T("Game Settings", "Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings); - rightColumnChoices->Add(new Choice(mm->T("About PPSSPP")))->OnClick.Handle(this, &MainScreen::OnCredits); + rightColumnChoices->Add(vertical ? new Choice(ImageID("I_GEAR")) : new Choice(mm->T("Game Settings", "Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings); + rightColumnChoices->Add(vertical ? new Choice(ImageID("I_INFO")) : new Choice(mm->T("About PPSSPP")))->OnClick.Handle(this, &MainScreen::OnCredits); if (!vertical) { rightColumnChoices->Add(new Choice(mm->T("www.ppsspp.org")))->OnClick.Handle(this, &MainScreen::OnPPSSPPOrg); - if (!System_GetPropertyBool(SYSPROP_APP_GOLD) && (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) != DEVICE_TYPE_VR)) { - Choice *gold = rightColumnChoices->Add(new Choice(mm->T("Buy PPSSPP Gold"))); - ScreenManager *sm = screenManager(); - gold->OnClick.Add([sm](UI::EventParams &) { - LaunchBuyGold(sm); - }); - gold->SetIcon(ImageID("I_ICON_GOLD"), 0.5f); - gold->SetShine(true); - } + } + + if (!System_GetPropertyBool(SYSPROP_APP_GOLD) && (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) != DEVICE_TYPE_VR)) { + Choice *gold = rightColumnChoices->Add(vertical ? new Choice(ImageID("I_ICON_GOLD")) : new Choice(mm->T("Buy PPSSPP Gold"))); + gold->OnClick.Add([this](UI::EventParams &) { + LaunchBuyGold(this->screenManager()); + }); + gold->SetIcon(ImageID("I_ICON_GOLD"), 0.5f); + gold->SetImageScale(0.5f); // for the left-icon in case of vertical. + gold->SetShine(true); } if (!vertical) {