aboutsummaryrefslogtreecommitdiff
path: root/gui/GuiManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/GuiManager.cpp')
-rw-r--r--gui/GuiManager.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index cf8b7b2d9d..21b437fb6e 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -72,7 +72,6 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled),
error("Failed to load any GUI theme, aborting");
}
}
- _themeChange = false;
}
GuiManager::~GuiManager() {
@@ -143,12 +142,20 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx)
// Enable the new theme
//
_theme = newTheme;
- _themeChange = true;
+ _useStdCursor = !_theme->ownCursor();
+
+ // If _stateIsSaved is set, we know that a Theme is already initialized,
+ // thus we initialize the new theme properly
+ if (_stateIsSaved) {
+ _theme->enable();
+
+ if (_useStdCursor)
+ setupCursor();
+ }
// refresh all dialogs
- for (int i = 0; i < _dialogStack.size(); ++i) {
+ for (int i = 0; i < _dialogStack.size(); ++i)
_dialogStack[i]->reflowLayout();
- }
// We need to redraw immediately. Otherwise
// some other event may cause a widget to be
@@ -233,7 +240,6 @@ void GuiManager::runLoop() {
// _theme->refresh();
- _themeChange = false;
_redrawStatus = kRedrawFull;
redraw();
}
@@ -285,21 +291,6 @@ void GuiManager::runLoop() {
Common::Point mouse(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y);
- // HACK to change the cursor to the new themes one
- if (_themeChange) {
- _theme->enable();
-
- _useStdCursor = !_theme->ownCursor();
- if (_useStdCursor)
- setupCursor();
-
-// _theme->refresh();
-
- _themeChange = false;
- _redrawStatus = kRedrawFull;
- redraw();
- }
-
if (lastRedraw + waitTime < _system->getMillis()) {
_theme->updateScreen();
_system->updateScreen();