[Scummvm-git-logs] scummvm master -> 8c1d277a77fbc063035119cb3b0fcc0ccb5c71fe

bluegr bluegr at gmail.com
Wed Jan 22 05:55:47 UTC 2020


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

Summary:
c0aa5b9332 GUI: Split GlobalOptionsDialog::build() into multiple functions
8c1d277a77 GUI: Use a ScrollContainer for the Misc tab


Commit: c0aa5b93320e8190e4bdc1e9ae87ec860438d5df
    https://github.com/scummvm/scummvm/commit/c0aa5b93320e8190e4bdc1e9ae87ec860438d5df
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2020-01-22T07:55:42+02:00

Commit Message:
GUI: Split GlobalOptionsDialog::build() into multiple functions

Changed paths:
    gui/options.cpp
    gui/options.h


diff --git a/gui/options.cpp b/gui/options.cpp
index 42c422f..37a75b3 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1598,10 +1598,6 @@ void GlobalOptionsDialog::build() {
 	_midiTabId = tab->addTab(_("MIDI"), "GlobalOptions_MIDI");
 	addMIDIControls(tab, "GlobalOptions_MIDI.");
 
-#ifdef USE_FLUIDSYNTH
-	new ButtonWidget(tab, "GlobalOptions_MIDI.mcFluidSynthSettings", _("FluidSynth Settings"), nullptr, kFluidSynthSettingsCmd);
-#endif
-
 	//
 	// 4) The MT-32 tab
 	//
@@ -1615,46 +1611,7 @@ void GlobalOptionsDialog::build() {
 		_pathsTabId = tab->addTab(_("Paths"), "GlobalOptions_Paths");
 	else
 		_pathsTabId = tab->addTab(_c("Paths", "lowres"), "GlobalOptions_Paths");
-
-#if !defined(__DC__)
-	// These two buttons have to be extra wide, or the text will be
-	// truncated in the small version of the GUI.
-
-	// Save game path
-	if (g_system->getOverlayWidth() > 320)
-		new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", _("Save Path:"), _("Specifies where your saved games are put"), kChooseSaveDirCmd);
-	else
-		new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", _c("Save Path:", "lowres"), _("Specifies where your saved games are put"), kChooseSaveDirCmd);
-	_savePath = new StaticTextWidget(tab, "GlobalOptions_Paths.SavePath", "/foo/bar", _("Specifies where your saved games are put"));
-
-	_savePathClearButton = addClearButton(tab, "GlobalOptions_Paths.SavePathClearButton", kSavePathClearCmd);
-
-	if (g_system->getOverlayWidth() > 320)
-		new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), nullptr, kChooseThemeDirCmd);
-	else
-		new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _c("Theme Path:", "lowres"), nullptr, kChooseThemeDirCmd);
-	_themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _c("None", "path"));
-
-	_themePathClearButton = addClearButton(tab, "GlobalOptions_Paths.ThemePathClearButton", kThemePathClearCmd);
-
-	if (g_system->getOverlayWidth() > 320)
-		new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _("Extra Path:"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
-	else
-		new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _c("Extra Path:", "lowres"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
-	_extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _c("None", "path"), _("Specifies path to additional data used by all games or ScummVM"));
-
-	_extraPathClearButton = addClearButton(tab, "GlobalOptions_Paths.ExtraPathClearButton", kExtraPathClearCmd);
-
-#ifdef DYNAMIC_MODULES
-	if (g_system->getOverlayWidth() > 320)
-		new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), nullptr, kChoosePluginsDirCmd);
-	else
-		new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _c("Plugins Path:", "lowres"), nullptr, kChoosePluginsDirCmd);
-	_pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _c("None", "path"));
-
-	_pluginsPathClearButton = addClearButton(tab, "GlobalOptions_Paths.PluginsPathClearButton", kPluginsPathClearCmd);
-#endif
-#endif
+	addPathsControls(tab, "GlobalOptions_Paths.", g_system->getOverlayWidth() <= 320);
 
 	//
 	// 6) The miscellaneous tab
@@ -1663,102 +1620,7 @@ void GlobalOptionsDialog::build() {
 		tab->addTab(_("Misc"), "GlobalOptions_Misc");
 	else
 		tab->addTab(_c("Misc", "lowres"), "GlobalOptions_Misc");
-
-	new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", _("Theme:"), nullptr, kChooseThemeCmd);
-	_curTheme = new StaticTextWidget(tab, "GlobalOptions_Misc.CurTheme", g_gui.theme()->getThemeName());
-
-
-	_rendererPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.RendererPopupDesc", _("GUI renderer:"));
-	_rendererPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.RendererPopup");
-
-	if (g_system->getOverlayWidth() > 320) {
-		for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i)
-			_rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].name), GUI::ThemeEngine::_rendererModes[i].mode);
-	} else {
-		for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i)
-			_rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].shortname), GUI::ThemeEngine::_rendererModes[i].mode);
-	}
-
-	if (g_system->getOverlayWidth() > 320)
-		_autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _("Autosave:"));
-	else
-		_autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _c("Autosave:", "lowres"));
-	_autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopup");
-
-	for (int i = 0; savePeriodLabels[i]; i++) {
-		_autosavePeriodPopUp->appendEntry(_(savePeriodLabels[i]), savePeriodValues[i]);
-	}
-
-#ifdef GUI_ENABLE_KEYSDIALOG
-	new ButtonWidget(tab, "GlobalOptions_Misc.KeysButton", _("Keys"), nullptr, kChooseKeyMappingCmd);
-#endif
-
-	// TODO: joystick setting
-
-
-#ifdef USE_TRANSLATION
-	_guiLanguagePopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.GuiLanguagePopupDesc", _("GUI language:"), _("Language of ScummVM GUI"));
-	_guiLanguagePopUp = new PopUpWidget(tab, "GlobalOptions_Misc.GuiLanguagePopup");
-#ifdef USE_DETECTLANG
-	_guiLanguagePopUp->appendEntry(_("<default>"), Common::kTranslationAutodetectId);
-#endif // USE_DETECTLANG
-	_guiLanguagePopUp->appendEntry("English", Common::kTranslationBuiltinId);
-	_guiLanguagePopUp->appendEntry("", 0);
-	Common::TLangArray languages = TransMan.getSupportedLanguageNames();
-	Common::TLangArray::iterator lang = languages.begin();
-	while (lang != languages.end()) {
-		_guiLanguagePopUp->appendEntry(lang->name, lang->id);
-		lang++;
-	}
-
-	// Select the currently configured language or default/English if
-	// nothing is specified.
-	if (ConfMan.hasKey("gui_language") && !ConfMan.get("gui_language").empty())
-		_guiLanguagePopUp->setSelectedTag(TransMan.parseLanguage(ConfMan.get("gui_language")));
-	else
-#ifdef USE_DETECTLANG
-		_guiLanguagePopUp->setSelectedTag(Common::kTranslationAutodetectId);
-#else // !USE_DETECTLANG
-		_guiLanguagePopUp->setSelectedTag(Common::kTranslationBuiltinId);
-#endif // USE_DETECTLANG
-
-	_guiLanguageUseGameLanguageCheckbox = new CheckboxWidget(tab, "GlobalOptions_Misc.GuiLanguageUseGameLanguage",
-			_("Switch the GUI language to the game language"),
-			_("When starting a game, change the GUI language to the game language."
-			"That way, if a game uses the ScummVM save and load dialogs, they are "
-			"in the same language as the game.")
-	);
-
-	if (ConfMan.hasKey("gui_use_game_language")) {
-		_guiLanguageUseGameLanguageCheckbox->setState(ConfMan.getBool("gui_use_game_language", _domain));
-	}
-
-#endif // USE_TRANSLATION
-
-	if (g_system->hasFeature(OSystem::kFeatureSystemBrowserDialog)) {
-		_useSystemDialogsCheckbox = new CheckboxWidget(tab, "GlobalOptions_Misc.UseSystemDialogs",
-			_("Use native system file browser"),
-			_("Use the native system file browser instead of the ScummVM one to select a file or directory.")
-		);
-
-		_useSystemDialogsCheckbox->setState(ConfMan.getBool("gui_browser_native", _domain));
-	}
-
-#ifdef USE_UPDATES
-	_updatesPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.UpdatesPopupDesc", _("Update check:"), _("How often to check ScummVM updates"));
-	_updatesPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.UpdatesPopup");
-
-	const int *vals = Common::UpdateManager::getUpdateIntervals();
-
-	while (*vals != -1) {
-		_updatesPopUp->appendEntry(Common::UpdateManager::updateIntervalToString(*vals), *vals);
-		vals++;
-	}
-
-	_updatesPopUp->setSelectedTag(Common::UpdateManager::normalizeInterval(ConfMan.getInt("updates_check")));
-
-	new ButtonWidget(tab, "GlobalOptions_Misc.UpdatesCheckManuallyButton", _("Check now"), nullptr, kUpdatesCheckCmd);
-#endif
+	addMiscControls(tab, "GlobalOptions_Misc.", g_system->getOverlayWidth() <= 320);
 
 #ifdef USE_CLOUD
 #ifdef USE_LIBCURL
@@ -1795,30 +1657,7 @@ void GlobalOptionsDialog::build() {
 		tab->addTab(_("Accessibility"), "GlobalOptions_Accessibility");
 	else
 		tab->addTab(_c("Accessibility", "lowres"), "GlobalOptions_Accessibility");
-	_ttsCheckbox = new CheckboxWidget(tab, "GlobalOptions_Accessibility.TTSCheckbox",
-			_("Use Text to speech"), _("Will read text in gui on mouse over."));
-	if (ConfMan.hasKey("tts_enabled"))
-		_ttsCheckbox->setState(ConfMan.getBool("tts_enabled", _domain));
-	else
-		_ttsCheckbox->setState(false);
-
-	_ttsVoiceSelectionPopUp = new PopUpWidget(tab, "GlobalOptions_Accessibility.TTSVoiceSelection");
-	Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
-	Common::Array<Common::TTSVoice> voices;
-	if (ttsMan != nullptr)
-		voices = ttsMan->getVoicesArray();
-
-	for(unsigned i = 0; i < voices.size(); i++) {
-		_ttsVoiceSelectionPopUp->appendEntry(voices[i].getDescription(), i);
-	}
-	if (voices.empty())
-		_ttsVoiceSelectionPopUp->appendEntry("None", 0);
-
-	if (ConfMan.hasKey("tts_voice") && (unsigned) ConfMan.getInt("tts_voice", _domain) < voices.size())
-		_ttsVoiceSelectionPopUp->setSelectedTag(ConfMan.getInt("tts_voice", _domain)) ;
-	else
-		_ttsVoiceSelectionPopUp->setSelectedTag(0);
-
+	addAccessibilityControls(tab, "GlobalOptions_Accessibility.");
 #endif // USE_TTS
 
 	// Activate the first tab
@@ -1913,6 +1752,154 @@ void GlobalOptionsDialog::clean() {
 	OptionsDialog::clean();
 }
 
+void GlobalOptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefix) {
+	OptionsDialog::addMIDIControls(boss, prefix);
+
+#ifdef USE_FLUIDSYNTH
+	new ButtonWidget(boss, prefix + "mcFluidSynthSettings", _("FluidSynth Settings"), nullptr, kFluidSynthSettingsCmd);
+#endif
+}
+
+void GlobalOptionsDialog::addPathsControls(GuiObject *boss, const Common::String &prefix, bool lowres) {
+#if !defined(__DC__)
+	// These two buttons have to be extra wide, or the text will be
+	// truncated in the small version of the GUI.
+
+	// Save game path
+	if (!lowres)
+		new ButtonWidget(boss, prefix + "SaveButton", _("Save Path:"), _("Specifies where your saved games are put"), kChooseSaveDirCmd);
+	else
+		new ButtonWidget(boss, prefix + "SaveButton", _c("Save Path:", "lowres"), _("Specifies where your saved games are put"), kChooseSaveDirCmd);
+	_savePath = new StaticTextWidget(boss, prefix + "SavePath", "/foo/bar", _("Specifies where your saved games are put"));
+
+	_savePathClearButton = addClearButton(boss, prefix + "SavePathClearButton", kSavePathClearCmd);
+
+	if (!lowres)
+		new ButtonWidget(boss, prefix + "ThemeButton", _("Theme Path:"), nullptr, kChooseThemeDirCmd);
+	else
+		new ButtonWidget(boss, prefix + "ThemeButton", _c("Theme Path:", "lowres"), nullptr, kChooseThemeDirCmd);
+	_themePath = new StaticTextWidget(boss, prefix + "ThemePath", _c("None", "path"));
+
+	_themePathClearButton = addClearButton(boss, prefix + "ThemePathClearButton", kThemePathClearCmd);
+
+	if (!lowres)
+		new ButtonWidget(boss, prefix + "ExtraButton", _("Extra Path:"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
+	else
+		new ButtonWidget(boss, prefix + "ExtraButton", _c("Extra Path:", "lowres"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
+	_extraPath = new StaticTextWidget(boss, prefix + "ExtraPath", _c("None", "path"), _("Specifies path to additional data used by all games or ScummVM"));
+
+	_extraPathClearButton = addClearButton(boss, prefix + "ExtraPathClearButton", kExtraPathClearCmd);
+
+#ifdef DYNAMIC_MODULES
+	if (!lowres)
+		new ButtonWidget(boss, prefix + "PluginsButton", _("Plugins Path:"), nullptr, kChoosePluginsDirCmd);
+	else
+		new ButtonWidget(boss, prefix + "PluginsButton", _c("Plugins Path:", "lowres"), nullptr, kChoosePluginsDirCmd);
+	_pluginsPath = new StaticTextWidget(boss, prefix + "PluginsPath", _c("None", "path"));
+
+	_pluginsPathClearButton = addClearButton(tab, "GlobalOptions_Paths.PluginsPathClearButton", kPluginsPathClearCmd);
+#endif
+#endif
+}
+
+void GlobalOptionsDialog::addMiscControls(GuiObject *boss, const Common::String &prefix, bool lowres) {
+	new ButtonWidget(boss, prefix + "ThemeButton", _("Theme:"), nullptr, kChooseThemeCmd);
+	_curTheme = new StaticTextWidget(boss, prefix + "CurTheme", g_gui.theme()->getThemeName());
+
+
+	_rendererPopUpDesc = new StaticTextWidget(boss, prefix + "RendererPopupDesc", _("GUI renderer:"));
+	_rendererPopUp = new PopUpWidget(boss, prefix + "RendererPopup");
+
+	if (!lowres) {
+		for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i)
+			_rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].name), GUI::ThemeEngine::_rendererModes[i].mode);
+	} else {
+		for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i)
+			_rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].shortname), GUI::ThemeEngine::_rendererModes[i].mode);
+	}
+
+	if (!lowres)
+		_autosavePeriodPopUpDesc = new StaticTextWidget(boss, prefix + "AutosavePeriodPopupDesc", _("Autosave:"));
+	else
+		_autosavePeriodPopUpDesc = new StaticTextWidget(boss, prefix + "AutosavePeriodPopupDesc", _c("Autosave:", "lowres"));
+	_autosavePeriodPopUp = new PopUpWidget(boss, prefix + "AutosavePeriodPopup");
+
+	for (int i = 0; savePeriodLabels[i]; i++) {
+		_autosavePeriodPopUp->appendEntry(_(savePeriodLabels[i]), savePeriodValues[i]);
+	}
+
+#ifdef GUI_ENABLE_KEYSDIALOG
+	new ButtonWidget(boss, prefix + "KeysButton", _("Keys"), nullptr, kChooseKeyMappingCmd);
+#endif
+
+	// TODO: joystick setting
+
+
+#ifdef USE_TRANSLATION
+	_guiLanguagePopUpDesc = new StaticTextWidget(boss, prefix + "GuiLanguagePopupDesc", _("GUI language:"), _("Language of ScummVM GUI"));
+	_guiLanguagePopUp = new PopUpWidget(boss, prefix + "GuiLanguagePopup");
+#ifdef USE_DETECTLANG
+	_guiLanguagePopUp->appendEntry(_("<default>"), Common::kTranslationAutodetectId);
+#endif // USE_DETECTLANG
+	_guiLanguagePopUp->appendEntry("English", Common::kTranslationBuiltinId);
+	_guiLanguagePopUp->appendEntry("", 0);
+	Common::TLangArray languages = TransMan.getSupportedLanguageNames();
+	Common::TLangArray::iterator lang = languages.begin();
+	while (lang != languages.end()) {
+		_guiLanguagePopUp->appendEntry(lang->name, lang->id);
+		lang++;
+	}
+
+	// Select the currently configured language or default/English if
+	// nothing is specified.
+	if (ConfMan.hasKey("gui_language") && !ConfMan.get("gui_language").empty())
+		_guiLanguagePopUp->setSelectedTag(TransMan.parseLanguage(ConfMan.get("gui_language")));
+	else
+#ifdef USE_DETECTLANG
+		_guiLanguagePopUp->setSelectedTag(Common::kTranslationAutodetectId);
+#else // !USE_DETECTLANG
+		_guiLanguagePopUp->setSelectedTag(Common::kTranslationBuiltinId);
+#endif // USE_DETECTLANG
+
+	_guiLanguageUseGameLanguageCheckbox = new CheckboxWidget(boss, prefix + "GuiLanguageUseGameLanguage",
+			_("Switch the GUI language to the game language"),
+			_("When starting a game, change the GUI language to the game language."
+			"That way, if a game uses the ScummVM save and load dialogs, they are "
+			"in the same language as the game.")
+	);
+
+	if (ConfMan.hasKey("gui_use_game_language")) {
+		_guiLanguageUseGameLanguageCheckbox->setState(ConfMan.getBool("gui_use_game_language", _domain));
+	}
+
+#endif // USE_TRANSLATION
+
+	if (g_system->hasFeature(OSystem::kFeatureSystemBrowserDialog)) {
+		_useSystemDialogsCheckbox = new CheckboxWidget(boss, prefix + "UseSystemDialogs",
+			_("Use native system file browser"),
+			_("Use the native system file browser instead of the ScummVM one to select a file or directory.")
+		);
+
+		_useSystemDialogsCheckbox->setState(ConfMan.getBool("gui_browser_native", _domain));
+	}
+
+#ifdef USE_UPDATES
+	_updatesPopUpDesc = new StaticTextWidget(boss, prefix + "UpdatesPopupDesc", _("Update check:"), _("How often to check ScummVM updates"));
+	_updatesPopUp = new PopUpWidget(boss, prefix + "UpdatesPopup");
+
+	const int *vals = Common::UpdateManager::getUpdateIntervals();
+
+	while (*vals != -1) {
+		_updatesPopUp->appendEntry(Common::UpdateManager::updateIntervalToString(*vals), *vals);
+		vals++;
+	}
+
+	_updatesPopUp->setSelectedTag(Common::UpdateManager::normalizeInterval(ConfMan.getInt("updates_check")));
+
+	new ButtonWidget(boss, prefix + "UpdatesCheckManuallyButton", _("Check now"), nullptr, kUpdatesCheckCmd);
+#endif
+}
+
 #ifdef USE_CLOUD
 #ifdef USE_LIBCURL
 void GlobalOptionsDialog::addCloudControls(GuiObject *boss, const Common::String &prefix, bool lowres) {
@@ -2007,6 +1994,34 @@ void GlobalOptionsDialog::addNetworkControls(GuiObject *boss, const Common::Stri
 #endif // USE_SDL_NET
 #endif // USE_CLOUD
 
+#ifdef USE_TTS
+void GlobalOptionsDialog::addAccessibilityControls(GuiObject *boss, const Common::String &prefix) {
+	_ttsCheckbox = new CheckboxWidget(boss, prefix + "TTSCheckbox",
+			_("Use Text to speech"), _("Will read text in gui on mouse over."));
+	if (ConfMan.hasKey("tts_enabled"))
+		_ttsCheckbox->setState(ConfMan.getBool("tts_enabled", _domain));
+	else
+		_ttsCheckbox->setState(false);
+
+	_ttsVoiceSelectionPopUp = new PopUpWidget(boss, prefix + "TTSVoiceSelection");
+	Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+	Common::Array<Common::TTSVoice> voices;
+	if (ttsMan != nullptr)
+		voices = ttsMan->getVoicesArray();
+
+	for(unsigned i = 0; i < voices.size(); i++) {
+		_ttsVoiceSelectionPopUp->appendEntry(voices[i].getDescription(), i);
+	}
+	if (voices.empty())
+		_ttsVoiceSelectionPopUp->appendEntry("None", 0);
+
+	if (ConfMan.hasKey("tts_voice") && (unsigned) ConfMan.getInt("tts_voice", _domain) < voices.size())
+		_ttsVoiceSelectionPopUp->setSelectedTag(ConfMan.getInt("tts_voice", _domain)) ;
+	else
+		_ttsVoiceSelectionPopUp->setSelectedTag(0);
+}
+#endif
+
 void GlobalOptionsDialog::apply() {
 	OptionsDialog::apply();
 
diff --git a/gui/options.h b/gui/options.h
index 5e8a318..ba90d92 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -261,6 +261,9 @@ protected:
 #ifdef USE_FLUIDSYNTH
 	FluidSynthSettingsDialog *_fluidSynthSettingsDialog;
 #endif
+
+	void addMIDIControls(GuiObject *boss, const Common::String &prefix);
+
 	StaticTextWidget *_savePath;
 	ButtonWidget	 *_savePathClearButton;
 	StaticTextWidget *_themePath;
@@ -272,6 +275,8 @@ protected:
 	ButtonWidget	 *_pluginsPathClearButton;
 #endif
 
+	void addPathsControls(GuiObject *boss, const Common::String &prefix, bool lowres);
+
 	//
 	// Misc controls
 	//
@@ -291,6 +296,8 @@ protected:
 	PopUpWidget *_updatesPopUp;
 #endif
 
+	void addMiscControls(GuiObject *boss, const Common::String &prefix, bool lowres);
+
 #ifdef USE_CLOUD
 #ifdef USE_LIBCURL
 	//
@@ -362,6 +369,8 @@ protected:
 	bool _enableTTS;
 	CheckboxWidget *_ttsCheckbox;
 	PopUpWidget *_ttsVoiceSelectionPopUp;
+
+	void addAccessibilityControls(GuiObject *boss, const Common::String &prefix);
 #endif
 };
 


Commit: 8c1d277a77fbc063035119cb3b0fcc0ccb5c71fe
    https://github.com/scummvm/scummvm/commit/8c1d277a77fbc063035119cb3b0fcc0ccb5c71fe
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2020-01-22T07:55:42+02:00

Commit Message:
GUI: Use a ScrollContainer for the Misc tab

Fixes Trac #10961

Changed paths:
    gui/ThemeEngine.h
    gui/options.cpp
    gui/themes/default.inc
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/THEMERC
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/THEMERC
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummmodern/scummmodern_layout_lowres.stx
    gui/themes/scummremastered.zip
    gui/themes/scummremastered/THEMERC
    gui/themes/scummremastered/remastered_layout.stx
    gui/themes/scummremastered/remastered_layout_lowres.stx


diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 85750b7..e838063 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -37,7 +37,7 @@
 #include "graphics/pixelformat.h"
 
 
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.30"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.31"
 
 class OSystem;
 
diff --git a/gui/options.cpp b/gui/options.cpp
index 37a75b3..c513754 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1620,7 +1620,10 @@ void GlobalOptionsDialog::build() {
 		tab->addTab(_("Misc"), "GlobalOptions_Misc");
 	else
 		tab->addTab(_c("Misc", "lowres"), "GlobalOptions_Misc");
-	addMiscControls(tab, "GlobalOptions_Misc.", g_system->getOverlayWidth() <= 320);
+	ScrollContainerWidget *miscContainer = new ScrollContainerWidget(tab, "GlobalOptions_Misc.Container", "GlobalOptions_Misc_Container");
+	miscContainer->setTarget(this);
+	miscContainer->setBackgroundType(ThemeEngine::kWidgetBackgroundNo);
+	addMiscControls(miscContainer, "GlobalOptions_Misc_Container.", g_system->getOverlayWidth() <= 320);
 
 #ifdef USE_CLOUD
 #ifdef USE_LIBCURL
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 251126b..60a81b5 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1417,6 +1417,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "</layout>"
 "</dialog>"
 "<dialog name='GlobalOptions_Misc' overlays='Dialog.GlobalOptions.TabWidget'>"
+"<layout type='vertical' padding='0,0,0,0'>"
+"<widget name='Container'/>"
+"</layout>"
+"</dialog>"
+"<dialog name='GlobalOptions_Misc_Container' overlays='GlobalOptions_Misc.Container'>"
 "<layout type='vertical' padding='16,16,16,16' spacing='8'>"
 "<layout type='horizontal' padding='0,0,0,0' spacing='10' align='center'>"
 "<widget name='ThemeButton' "
@@ -3167,6 +3172,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "</layout>"
 "</dialog>"
 "<dialog name='GlobalOptions_Misc' overlays='Dialog.GlobalOptions.TabWidget'>"
+"<layout type='vertical' padding='0,0,0,0'>"
+"<widget name='Container'/>"
+"</layout>"
+"</dialog>"
+"<dialog name='GlobalOptions_Misc_Container' overlays='GlobalOptions_Misc.Container'>"
 "<layout type='vertical' padding='16,16,16,16' spacing='8'>"
 "<layout type='horizontal' padding='0,0,0,0' spacing='16'>"
 "<widget name='ThemeButton' "
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 4d5ad8d..91b5dda 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 63a24a1..4aec101 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.30:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8.31:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index de2d686..7e9c2c0 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -549,6 +549,12 @@
 	</dialog>
 
 	<dialog name = 'GlobalOptions_Misc' overlays = 'Dialog.GlobalOptions.TabWidget'>
+		<layout type = 'vertical' padding = '0, 0, 0, 0'>
+			<widget name = 'Container'/>
+		</layout>
+	</dialog>
+
+	<dialog name = 'GlobalOptions_Misc_Container' overlays = 'GlobalOptions_Misc.Container'>
 		<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
 				<widget name = 'ThemeButton'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index a89a511..a96c8fe 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -545,6 +545,12 @@
 	</dialog>
 
 	<dialog name = 'GlobalOptions_Misc' overlays = 'Dialog.GlobalOptions.TabWidget'>
+		<layout type = 'vertical' padding = '0, 0, 0, 0'>
+			<widget name = 'Container'/>
+		</layout>
+	</dialog>
+
+	<dialog name = 'GlobalOptions_Misc_Container' overlays = 'GlobalOptions_Misc.Container'>
 		<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'>
 				<widget name = 'ThemeButton'
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 054fbe7..c45b73f 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index 1071753..8051170 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.30:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.8.31:ScummVM Modern Theme:No Author]
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index a90ed89..204a6fb 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -563,6 +563,12 @@
 	</dialog>
 
 	<dialog name = 'GlobalOptions_Misc' overlays = 'Dialog.GlobalOptions.TabWidget'>
+		<layout type = 'vertical' padding = '0, 0, 0, 0'>
+			<widget name = 'Container'/>
+		</layout>
+	</dialog>
+
+	<dialog name = 'GlobalOptions_Misc_Container' overlays = 'GlobalOptions_Misc.Container'>
 		<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
 				<widget name = 'ThemeButton'
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 4ea4606..a2c2b61 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -543,6 +543,12 @@
 	</dialog>
 
 	<dialog name = 'GlobalOptions_Misc' overlays = 'Dialog.GlobalOptions.TabWidget'>
+		<layout type = 'vertical' padding = '0, 0, 0, 0'>
+			<widget name = 'Container'/>
+		</layout>
+	</dialog>
+
+	<dialog name = 'GlobalOptions_Misc_Container' overlays = 'GlobalOptions_Misc.Container'>
 		<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' align = 'center'>
 				<widget name = 'ThemeButton'
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index 9d666c2..01f05cb 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ
diff --git a/gui/themes/scummremastered/THEMERC b/gui/themes/scummremastered/THEMERC
index e2d57b1..3b6a6d4 100644
--- a/gui/themes/scummremastered/THEMERC
+++ b/gui/themes/scummremastered/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.30:ScummVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.8.31:ScummVM Modern Theme Remastered:No Author]
diff --git a/gui/themes/scummremastered/remastered_layout.stx b/gui/themes/scummremastered/remastered_layout.stx
index 782c2b1..4e62314 100644
--- a/gui/themes/scummremastered/remastered_layout.stx
+++ b/gui/themes/scummremastered/remastered_layout.stx
@@ -563,6 +563,12 @@
 	</dialog>
 
 	<dialog name = 'GlobalOptions_Misc' overlays = 'Dialog.GlobalOptions.TabWidget'>
+		<layout type = 'vertical' padding = '0, 0, 0, 0'>
+			<widget name = 'Container'/>
+		</layout>
+	</dialog>
+
+	<dialog name = 'GlobalOptions_Misc_Container' overlays = 'GlobalOptions_Misc.Container'>
 		<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
 				<widget name = 'ThemeButton'
diff --git a/gui/themes/scummremastered/remastered_layout_lowres.stx b/gui/themes/scummremastered/remastered_layout_lowres.stx
index 4ea4606..a2c2b61 100644
--- a/gui/themes/scummremastered/remastered_layout_lowres.stx
+++ b/gui/themes/scummremastered/remastered_layout_lowres.stx
@@ -543,6 +543,12 @@
 	</dialog>
 
 	<dialog name = 'GlobalOptions_Misc' overlays = 'Dialog.GlobalOptions.TabWidget'>
+		<layout type = 'vertical' padding = '0, 0, 0, 0'>
+			<widget name = 'Container'/>
+		</layout>
+	</dialog>
+
+	<dialog name = 'GlobalOptions_Misc_Container' overlays = 'GlobalOptions_Misc.Container'>
 		<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' align = 'center'>
 				<widget name = 'ThemeButton'




More information about the Scummvm-git-logs mailing list