[Scummvm-git-logs] scummvm master -> 6db11ef60552a8c0fc6bcc56425636351dfd178e

sev- noreply at scummvm.org
Sat Jan 20 19:57:45 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6db11ef605 GUI: Allow manual setting of custom GUI scale values


Commit: 6db11ef60552a8c0fc6bcc56425636351dfd178e
    https://github.com/scummvm/scummvm/commit/6db11ef60552a8c0fc6bcc56425636351dfd178e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-01-20T20:56:53+01:00

Commit Message:
GUI: Allow manual setting of custom GUI scale values

We keep this value and do not override it

Changed paths:
    gui/options.cpp


diff --git a/gui/options.cpp b/gui/options.cpp
index e8ab7bd736d..31f646e14c9 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2386,13 +2386,22 @@ void GlobalOptionsDialog::build() {
 #endif
 
 	// Misc Tab
-	_guiBasePopUp->setSelected(2);
+	bool seenValue = false;
 	int value = ConfMan.getInt("gui_scale");
+
+	if (!value)
+		value = 100; // Setting default sane value
+
 	for (int i = 0; guiBaseLabels[i]; i++) {
-		if (value == guiBaseValues[i])
+		if (value == guiBaseValues[i]) {
+			seenValue = true;
 			_guiBasePopUp->setSelected(i);
+		}
 	}
 
+	if (!seenValue)
+		_guiBasePopUp->setSelected(ARRAYSIZE(guiBaseLabels) - 1);
+
 	_autosavePeriodPopUp->setSelected(1);
 	value = ConfMan.getInt("autosave_period");
 	for (int i = 0; savePeriodLabels[i]; i++) {
@@ -2538,10 +2547,24 @@ void GlobalOptionsDialog::addGUIControls(GuiObject *boss, const Common::String &
 	_guiBasePopUpDesc = new StaticTextWidget(boss, prefix + "GUIBasePopupDesc", _("GUI scale:"));
 	_guiBasePopUp = new PopUpWidget(boss, prefix + "GUIBasePopup");
 
+	bool seenValue = false;
+	int oldGuiScale = ConfMan.getInt("gui_scale");
+
+	if (!oldGuiScale)
+		oldGuiScale = 100; // Setting default sane value
+
 	for (int i = 0; guiBaseLabels[i]; i++) {
+		if (guiBaseValues[i] == oldGuiScale)
+			seenValue = true;
+
 		_guiBasePopUp->appendEntry(_(guiBaseLabels[i]), guiBaseValues[i]);
 	}
 
+	if (!seenValue) {
+		Common::U32String customText = Common::U32String::format(_("%d%% - Custom"), oldGuiScale);
+		_guiBasePopUp->appendEntry(customText, oldGuiScale);
+	}
+
 	_rendererPopUpDesc = new StaticTextWidget(boss, prefix + "RendererPopupDesc", _("GUI renderer:"));
 	_rendererPopUp = new PopUpWidget(boss, prefix + "RendererPopup");
 




More information about the Scummvm-git-logs mailing list