DisplaySettings: Capitalize fallback display mode when loading settings

This setting was capitalized a while ago, except for this place where
we fall back to "[C]center". This caused a crash in MonitorWidget.
This commit is contained in:
Julian Offenhäuser 2023-02-09 15:06:57 +01:00 committed by Andreas Kling
parent 2649bc737f
commit ab5b61c3fe

View file

@ -130,10 +130,10 @@ void BackgroundSettingsWidget::load_current_settings()
m_monitor_widget->set_wallpaper(selected_wallpaper);
}
auto mode = ws_config->read_entry("Background", "Mode", "center");
auto mode = ws_config->read_entry("Background", "Mode", "Center");
if (!m_modes.contains_slow(mode)) {
warnln("Invalid background mode '{}' in WindowServer config, falling back to 'center'", mode);
mode = "center";
warnln("Invalid background mode '{}' in WindowServer config, falling back to 'Center'", mode);
mode = "Center";
}
m_monitor_widget->set_wallpaper_mode(mode);
m_mode_combo->set_selected_index(m_modes.find_first_index(mode).value_or(0), GUI::AllowCallback::No);