diff options
author | Joseph-Eugene Winzer | 2017-03-09 00:01:55 +0100 |
---|---|---|
committer | Joseph-Eugene Winzer | 2017-03-09 04:26:20 +0100 |
commit | f39412fcec6ae9310b0587df6b4a5e6a5b5ab427 (patch) | |
tree | 34bd2e4605fabbe0b4fd26be10d871447426262a /gui | |
parent | 66c2ae244f6098c6af5120c96c616a1739d0ae02 (diff) | |
download | scummvm-rg350-f39412fcec6ae9310b0587df6b4a5e6a5b5ab427.tar.gz scummvm-rg350-f39412fcec6ae9310b0587df6b4a5e6a5b5ab427.tar.bz2 scummvm-rg350-f39412fcec6ae9310b0587df6b4a5e6a5b5ab427.zip |
GUI: Fix Theme Label in Options->Misc
The theme label in the Misc tab will not change to the correct theme
when current language and theme is changed and 'apply' pressed.
loadNewTheme() does not do a rebuild of all widgets, including the
theme label, like it is explicitly done in the 'language section'.
The problem is that rebuild() uses the currently applied settings to
rebuild all widgets. Although a new theme was selected by the user the
label will be overwritten with the name of the still active theme.
By rearranging the logic a complete rebuild of the GUI is done and
updates the widgets correctly.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/options.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/gui/options.cpp b/gui/options.cpp index 5b62d493c4..7a22a9ba3f 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -1838,24 +1838,6 @@ void GlobalOptionsDialog::apply() { g_gui.loadNewTheme(g_gui.theme()->getThemeId(), selected); ConfMan.set("gui_renderer", cfg, _domain); } -#ifdef USE_TRANSLATION - Common::String oldLang = ConfMan.get("gui_language"); - int selLang = _guiLanguagePopUp->getSelectedTag(); - - ConfMan.set("gui_language", TransMan.getLangById(selLang)); - - Common::String newLang = ConfMan.get("gui_language").c_str(); - if (newLang != oldLang) { - // Activate the selected language - TransMan.setLanguage(selLang); - - // Rebuild the Launcher and Options dialogs - g_gui.loadNewTheme(g_gui.theme()->getThemeId(), ThemeEngine::kGfxDisabled, true); - rebuild(); - if (_launcher != 0) - _launcher->rebuild(); - } -#endif // USE_TRANSLATION #ifdef USE_UPDATES ConfMan.setInt("updates_check", _updatesPopUp->getSelectedTag()); @@ -1926,6 +1908,24 @@ void GlobalOptionsDialog::apply() { draw(); _newTheme.clear(); } +#ifdef USE_TRANSLATION + Common::String oldLang = ConfMan.get("gui_language"); + int selLang = _guiLanguagePopUp->getSelectedTag(); + + ConfMan.set("gui_language", TransMan.getLangById(selLang)); + + Common::String newLang = ConfMan.get("gui_language").c_str(); + if (newLang != oldLang) { + // Activate the selected language + TransMan.setLanguage(selLang); + + // Rebuild the Launcher and Options dialogs + g_gui.loadNewTheme(g_gui.theme()->getThemeId(), ThemeEngine::kGfxDisabled, true); + rebuild(); + if (_launcher != 0) + _launcher->rebuild(); + } +#endif // USE_TRANSLATION OptionsDialog::apply(); } |