In vertical mode, replace the mainscreen buttons with image buttons

This commit is contained in:
Henrik Rydgård committed 2025-10-23 15:43:08 +02:00
1 parent 28b9bc2fb3
commit 2404fc330d
3 files changed
+18 -14

No files matched your search

+2 -2
View File
@@ -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;
+3
View File
@@ -751,6 +751,9 @@ public:
void SetShine(bool shine) {
shine_ = true;
}
void SetImageScale(float scale) {
imgScale_ = scale;
}
protected:
void ClickInternal() override;
+13 -12
View File
@@ -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) {