1
0
Fork 0
Oliver Bechstein-Rumble 2025-06-26 07:35:46 +00:00 committed by GitHub
commit 87f00cfe40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -418,6 +418,7 @@ struct GameOptionsWindow : Window {
GameSettings *opt = nullptr;
bool reload = false;
int gui_scale = 0;
static inline int previous_gui_scale = 0; ///< Previous GUI scale.
static inline WidgetID active_tab = WID_GO_TAB_GENERAL;
GameOptionsWindow(WindowDesc &desc) : Window(desc), filter_editbox(50), gui_scale(_gui_scale)
@ -1066,9 +1067,13 @@ struct GameOptionsWindow : Window {
case WID_GO_GUI_SCALE_AUTO:
{
if (_gui_scale_cfg == -1) {
_gui_scale_cfg = _gui_scale;
_gui_scale_cfg = previous_gui_scale; // Store the previous GUI scale value
this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, false);
if (AdjustGUIZoom(false))
ReInitAllWindows(true);
this->gui_scale = _gui_scale;
} else {
previous_gui_scale = _gui_scale; // Set the previous GUI scale value as the current one
_gui_scale_cfg = -1;
this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, true);
if (AdjustGUIZoom(false)) ReInitAllWindows(true);