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) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-22 10:55:30 +02:00
1 parent fbf101de36
commit 75ac7b6de8
1 file changed
+5 -2
+5 -2
View File
@@ -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<std::string> 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)