DisplayLayoutScreen: Round the right column

This commit is contained in:
Henrik Rydgård committed 2026-10-26 23:27:34 +01:00
1 parent 4d26021a9b
commit 203c037b8e
1 file changed
+13 -19
+13 -19
View File
@@ -252,16 +252,13 @@ void DisplayLayoutScreen::CreateViews() {
}
ScrollView *rightScrollView = new ScrollView(ORIENT_VERTICAL, new AnchorLayoutParams(300.0f, FILL_PARENT, NONE, 0.f, 0.f, 0.f));
LinearLayout *rightColumn = new LinearLayout(ORIENT_VERTICAL);
rightColumn->SetPadding(Margins(8));
rightColumn->SetSpacing(0.0f);
ChoiceGroupList *rightColumn = new ChoiceGroupList();
rightScrollView->Add(rightColumn);
rightScrollView->SetClickableBackground(true);
root_->Add(rightScrollView);
Choice *back = rightColumn->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK")));
Choice *back = rightColumn->Add(new ChoiceGroup())->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK")));
back->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
rightColumn->Add(new Spacer(12.0f));
LinearLayout *bottomControls;
if (portrait) {
@@ -279,23 +276,23 @@ void DisplayLayoutScreen::CreateViews() {
rightColumn->SetBG(backgroundWithAlpha);
if (!IsVREnabled()) {
ChoiceGroup *scaleGroup = rightColumn->Add(new ChoiceGroup());
if (portrait == internalPortrait) {
// Stretch doesn't make sense in portrait mode (looks crazy), so we only show it in landscape mode.
// Vice versa if internal is portrait.
auto stretch = new CheckBox(&config.bDisplayStretch, gr->T("Stretch"));
auto stretch = scaleGroup->Add(new CheckBox(&config.bDisplayStretch, gr->T("Stretch")));
stretch->SetDisabledPtr(&config.bDisplayIntegerScale);
rightColumn->Add(stretch);
}
PopupSliderChoiceFloat *aspectRatio = new PopupSliderChoiceFloat(&config.fDisplayAspectRatio, 0.1f, 2.0f, 1.0f, gr->T("Aspect Ratio"), screenManager());
rightColumn->Add(aspectRatio);
PopupSliderChoiceFloat *aspectRatio = scaleGroup->Add(new PopupSliderChoiceFloat(&config.fDisplayAspectRatio, 0.1f, 2.0f, 1.0f, gr->T("Aspect Ratio"), screenManager()));
aspectRatio->SetEnabledFunc([&config]() {
return !config.bDisplayStretch && !config.bDisplayIntegerScale;
});
aspectRatio->SetHasDropShadow(false);
aspectRatio->SetLiveUpdate(true);
rightColumn->Add(new CheckBox(&config.bDisplayIntegerScale, gr->T("Integer scale factor")));
scaleGroup->Add(new CheckBox(&config.bDisplayIntegerScale, gr->T("Integer scale factor")));
bool supportsInsets = false;
#if PPSSPP_PLATFORM(ANDROID)
@@ -313,18 +310,17 @@ void DisplayLayoutScreen::CreateViews() {
insetTop != 0.0f ||
insetRight != 0.0f ||
insetBottom != 0.0f) && (insetLeft != insetTop || insetRight != insetBottom)) {
rightColumn->Add(new CheckBox(&config.bIgnoreScreenInsets, gr->T("Ignore camera notch when centering")));
scaleGroup->Add(new CheckBox(&config.bIgnoreScreenInsets, gr->T("Ignore camera notch when centering")));
}
if (System_GetPropertyBool(SYSPROP_CAN_RESTRICT_ORIENTATION)) {
rightColumn->Add(new Spacer(12.0f));
AddRotationPicker(screenManager(), rightColumn, true);
}
rightColumn->Add(new ItemHeader(gr->T("PSP display rotation")));
ChoiceGroup *pspRotationGroup = rightColumn->Add(new ChoiceGroup(gr->T("PSP display rotation")));
static const char *displayRotation[] = { "Landscape", "Portrait", "Landscape Reversed", "Portrait Reversed" };
PopupMultiChoice *rotation = rightColumn->Add(new PopupMultiChoice(&config.iInternalScreenRotation, gr->T("Rotation"), displayRotation, 1, ARRAY_SIZE(displayRotation), I18NCat::CONTROLS, screenManager()));
PopupMultiChoice *rotation = pspRotationGroup->Add(new PopupMultiChoice(&config.iInternalScreenRotation, gr->T("Rotation"), displayRotation, 1, ARRAY_SIZE(displayRotation), I18NCat::CONTROLS, screenManager()));
rotation->OnChoice.Add([this](UI::EventParams &) {
// Affects the presence of the Stretch checkbox.
RecreateViews();
@@ -334,13 +330,11 @@ void DisplayLayoutScreen::CreateViews() {
});
rotation->SetHideTitle(true);
rightColumn->Add(new CheckBox(&config.bRotateControlsWithScreen, gr->T("Rotate controls")))->SetEnabledFunc([&config]() -> bool {
pspRotationGroup->Add(new CheckBox(&config.bRotateControlsWithScreen, gr->T("Rotate controls")))->SetEnabledFunc([&config]() -> bool {
return (!g_Config.bSkipBufferEffects || g_Config.bSoftwareRendering) && config.iInternalScreenRotation != 1;
});
rightColumn->Add(new Spacer(12.0f));
Choice *center = new Choice(di->T("Reset"));
Choice *center = rightColumn->Add(new ChoiceGroup())->Add(new Choice(di->T("Reset")));
center->OnClick.Add([this, &config, portrait](UI::EventParams &) {
// Hm, not really ideal to have to use strings here.
// The overlay is a choice of its own, not part of the size/position, so keep it.
@@ -350,7 +344,6 @@ void DisplayLayoutScreen::CreateViews() {
// Which checkboxes are shown depends on the rotation.
RecreateViews();
});
rightColumn->Add(center);
mode_ = new ChoiceStrip(ORIENT_HORIZONTAL, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT));
mode_->AddChoice(sy->T("Off"));
@@ -359,6 +352,7 @@ void DisplayLayoutScreen::CreateViews() {
mode_->SetSelection(0, false);
// The game goes to another output, like a TV, which doesn't use this layout.
mode_->SetEnabled(screenManager()->FindOutput(OutputRole::Game) == nullptr);
mode_->ApplyRoundCorners();
bottomControls->Add(mode_);
}