Tweak the slider popup dialogs. Update an URL.

This commit is contained in:
Henrik Rydgård committed 2026-11-07 11:03:43 +01:00
1 parent 7a22fe43a5
commit 990378df08
4 files changed
+19 -10

No files matched your search

+14 -7
View File
@@ -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())
+1 -1
View File
@@ -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),
+1 -1
View File
@@ -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"));
+3 -1
View File
@@ -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));