From 990378df083c276f827aa85815ec188cd420cada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 7 Nov 2026 10:46:24 +0100 Subject: [PATCH] Tweak the slider popup dialogs. Update an URL. --- Common/UI/PopupScreens.cpp | 21 ++++++++++++++------- Core/Config.cpp | 2 +- UI/FirmwareScreen.cpp | 2 +- UI/MainScreen.cpp | 4 +++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Common/UI/PopupScreens.cpp b/Common/UI/PopupScreens.cpp index 4867fcc616..4a27d80fe0 100644 --- a/Common/UI/PopupScreens.cpp +++ b/Common/UI/PopupScreens.cpp @@ -662,13 +662,13 @@ void SliderPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { LinearLayout *lin = vert->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(UI::Margins(10, 10)))); Button *decrease = lin->Add(new Button("", ImageID("I_MINUS"), new LayoutParams(60.0f, 60.0f))); decrease->OnClick.Handle(this, &SliderPopupScreen::OnDecrease); - decrease->SetRoundCorners(); Button *increase = lin->Add(new Button("", ImageID("I_PLUS"), new LayoutParams(60.0f, 60.0f))); increase->OnClick.Handle(this, &SliderPopupScreen::OnIncrease); - increase->SetRoundCorners(); edit_ = new TextEdit("", Title(), "", new LinearLayoutParams(1.0f)); edit_->SetMaxLen(16); + edit_->SetTextColor(dc.GetTheme().itemStyle.fgColor); + edit_->SetTextAlign(FLAG_DYNAMIC_ASCII); edit_->OnTextChange.Handle(this, &SliderPopupScreen::OnTextChange); changing_ = true; UpdateTextBox(); @@ -676,7 +676,7 @@ void SliderPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { lin->Add(edit_); if (!units_.empty()) - lin->Add(new TextView(units_)); + lin->Add(new TextView(units_, new LinearLayoutParams(0.0f, Gravity::G_VCENTER))); if (defaultValue_ != NO_DEFAULT_FLOAT) { auto di = GetI18NCategory(I18NCat::DIALOG); @@ -687,12 +687,13 @@ void SliderPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { UpdateTextBox(); changing_ = false; }); - reset->SetRoundCorners(); } if (!negativeLabel_.empty()) vert->Add(new CheckBox(&disabled_, negativeLabel_)); + lin->ApplyRoundCorners(); + if (IsFocusMovementEnabled()) UI::SetFocusedView(slider_, FocusFlags::CAUSE_SCREEN_CHANGE); } @@ -708,8 +709,10 @@ void SliderFloatPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { vert->Add(slider_); LinearLayout *lin = vert->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(UI::Margins(10, 10)))); - lin->Add(new Button("", ImageID("I_MINUS"), new LayoutParams(60.0f, 60.0f)))->OnClick.Handle(this, &SliderFloatPopupScreen::OnDecrease); - lin->Add(new Button("", ImageID("I_PLUS"), new LayoutParams(60.0f, 60.0f)))->OnClick.Handle(this, &SliderFloatPopupScreen::OnIncrease); + Button *decrease = lin->Add(new Button("", ImageID("I_MINUS"), new LayoutParams(60.0f, 60.0f))); + decrease->OnClick.Handle(this, &SliderFloatPopupScreen::OnDecrease); + Button *increase = lin->Add(new Button("", ImageID("I_PLUS"), new LayoutParams(60.0f, 60.0f))); + increase->OnClick.Handle(this, &SliderFloatPopupScreen::OnIncrease); edit_ = new TextEdit("", Title(), "", new LinearLayoutParams(1.0f)); edit_->SetMaxLen(16); @@ -720,18 +723,22 @@ void SliderFloatPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { UpdateTextBox(); changing_ = false; lin->Add(edit_); + if (!units_.empty()) lin->Add(new TextView(units_))->SetTextColor(dc.GetTheme().itemStyle.fgColor); if (defaultValue_ != NO_DEFAULT_FLOAT) { auto di = GetI18NCategory(I18NCat::DIALOG); - lin->Add(new Button(di->T("Reset"), new LayoutParams(WRAP_CONTENT, 60.0f)))->OnClick.Add([=](UI::EventParams &) { + Button *reset = lin->Add(new Button(di->T("Reset"), new LayoutParams(WRAP_CONTENT, 60.0f))); + reset->OnClick.Add([=](UI::EventParams &) { sliderValue_ = defaultValue_; if (liveUpdate_) { *value_ = defaultValue_; } }); + reset->SetRoundCorners(); } + lin->ApplyRoundCorners(); // slider_ = parent->Add(new SliderFloat(&sliderValue_, minValue_, maxValue_, new LinearLayoutParams(UI::Margins(10, 5)))); if (IsFocusMovementEnabled()) diff --git a/Core/Config.cpp b/Core/Config.cpp index 71759454f1..a56536f6cb 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -458,7 +458,7 @@ static constexpr ConfigSetting generalSettings[] = { ConfigSetting("RemoteISOSharedDir", SETTING(g_Config, sRemoteISOSharedDir), "", CfgFlag::DEFAULT), ConfigSetting("RemoteISOShareType", SETTING(g_Config, iRemoteISOShareType), (int)RemoteISOShareType::RECENT, CfgFlag::DEFAULT), ConfigSetting("AskForExitConfirmationAfterSeconds", SETTING(g_Config, iAskForExitConfirmationAfterSeconds), 300, CfgFlag::PER_GAME) - .Label(I18NCat::SYSTEM, "Ask for exit confirmation after seconds").Range(0, 1200).Units("s").ZeroLabel("Off"), + .Label(I18NCat::SYSTEM, "Ask for exit confirmation after seconds").Range(0, 1200).Units("seconds").ZeroLabel("Off"), #if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS) ConfigSetting("ScreenRotation", SETTING(g_Config, iScreenRotation), ROTATION_AUTO, CfgFlag::DEFAULT), diff --git a/UI/FirmwareScreen.cpp b/UI/FirmwareScreen.cpp index 6890b6a34a..3aa16c5c04 100644 --- a/UI/FirmwareScreen.cpp +++ b/UI/FirmwareScreen.cpp @@ -209,7 +209,7 @@ void FirmwareScreen::CreateSettingsViews(UI::ViewGroup *parent) { Choice *moreInfo = groups->Add(new ChoiceGroup())->Add(new Choice(di->T("More info"))); moreInfo->OnClick.Add([](UI::EventParams &) { - System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/docs/getting-started/how-to-run-the-vsh/"); + System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/docs/getting-started/how-to-run-the-xmb/"); }); moreInfo->SetIconRight(ImageID("I_LINK_OUT")); diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 5596a3171e..044a1a1957 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -993,7 +993,9 @@ void UmdReplaceScreen::CreateSettingsViews(UI::ViewGroup *parent) { auto mm = GetI18NCategory(I18NCat::MAINMENU); if (System_GetPropertyBool(SYSPROP_HAS_FILE_BROWSER)) { - parent->Add(new Choice(mm->T("Load", "Load...")))->OnClick.Add([this](UI::EventParams &e) { + ChoiceGroupList *settings = parent->Add(new ChoiceGroupList()); + ChoiceGroup *choices = settings->Add(new ChoiceGroup()); + choices->Add(new Choice(mm->T("Load", "Load..."), ImageID("I_FOLDER_OPEN")))->OnClick.Add([this](UI::EventParams &e) { auto mm = GetI18NCategory(I18NCat::MAINMENU); System_BrowseForFile(GetRequesterToken(), mm->T("Load"), BrowseFileType::BOOTABLE, [this](std::string_view value, int) { UseDisc(Path(value));