From 75ac7b6de84a992bc8fa547fb20b7ef07335ec6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 22 Oct 2026 08:56:23 +0200 Subject: [PATCH] DisplayLayout: Fix a few stale states - The aspect ratio slider captured a copy of the layout config, so its enabled state never followed the Stretch and Integer scale checkboxes. - Reset didn't refresh the views, which depend on the rotation. - The shader list popup kept its old index mapping when recreated, so the current shader wasn't highlighted. Co-Authored-By: Claude Opus 5.5 (1M context) --- UI/DisplayLayoutScreen.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/UI/DisplayLayoutScreen.cpp b/UI/DisplayLayoutScreen.cpp index 836c83ad30..208b1e4af9 100644 --- a/UI/DisplayLayoutScreen.cpp +++ b/UI/DisplayLayoutScreen.cpp @@ -268,7 +268,7 @@ void DisplayLayoutScreen::CreateViews() { PopupSliderChoiceFloat *aspectRatio = new PopupSliderChoiceFloat(&config.fDisplayAspectRatio, 0.1f, 2.0f, 1.0f, gr->T("Aspect Ratio"), screenManager()); rightColumn->Add(aspectRatio); - aspectRatio->SetEnabledFunc([config]() { + aspectRatio->SetEnabledFunc([&config]() { return !config.bDisplayStretch && !config.bDisplayIntegerScale; }); aspectRatio->SetHasDropShadow(false); @@ -322,9 +322,11 @@ void DisplayLayoutScreen::CreateViews() { rightColumn->Add(new Spacer(12.0f)); Choice *center = new Choice(di->T("Reset")); - center->OnClick.Add([&config, portrait](UI::EventParams &) { + center->OnClick.Add([this, &config, portrait](UI::EventParams &) { // Hm, not really ideal to have to use strings here. config.ResetToDefault(portrait ? "DisplayLayout.Portrait" : "DisplayLayout.Landscape"); + // Which checkboxes are shown depends on the rotation. + RecreateViews(); }); rightColumn->Add(center); @@ -514,6 +516,7 @@ void PostProcScreen::CreateViews() { std::vector items; int selected = -1; const std::string selectedName = id_ >= (int)g_Config.vPostShaderNames.size() ? "Off" : g_Config.vPostShaderNames[id_]; + indexTranslation_.clear(); for (int i = 0; i < (int)shaders_.size(); i++) { if (!shaders_[i].visible)