aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorVicent Marti2009-04-11 17:12:17 +0000
committerVicent Marti2009-04-11 17:12:17 +0000
commit8fe3735f69307894d52efc4ae2ff061549940946 (patch)
tree163201d24a5ce7c00a96908728509ff3d4ad6944 /gui
parent91b724451bb25133280ef523d91584baed3ec849 (diff)
downloadscummvm-rg350-8fe3735f69307894d52efc4ae2ff061549940946.tar.gz
scummvm-rg350-8fe3735f69307894d52efc4ae2ff061549940946.tar.bz2
scummvm-rg350-8fe3735f69307894d52efc4ae2ff061549940946.zip
Fixed bug #2706939 (Enabled button not drawn correctly) and other similar cases.
Fixed background shading weirdness when opening many dialogs on top of each other. Fixed some modal dialogs not redrawing properly when closed. svn-id: r39938
Diffstat (limited to 'gui')
-rw-r--r--gui/GuiManager.cpp18
-rw-r--r--gui/widget.cpp12
2 files changed, 21 insertions, 9 deletions
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index 3754622aea..f3954c112d 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -136,19 +136,25 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx)
void GuiManager::redraw() {
int i;
+ ThemeEngine::ShadingStyle shading;
- if (_redrawStatus == kRedrawDisabled)
+ if (_redrawStatus == kRedrawDisabled || _dialogStack.empty())
return;
- if (_dialogStack.empty())
- return;
+ shading = (ThemeEngine::ShadingStyle)xmlEval()->getVar("Dialog." + _dialogStack.top()->_name + ".Shading", 0);
+
+ // Tanoku: Do not apply shading more than once when opening many dialogs
+ // on top of each other. Screen ends up being too dark and it's a
+ // performance hog.
+ if (_redrawStatus == kRedrawOpenDialog && _dialogStack.size() > 2)
+ shading = ThemeEngine::kShadingNone;
switch (_redrawStatus) {
case kRedrawCloseDialog:
case kRedrawFull:
case kRedrawTopDialog:
_theme->clearAll();
- _theme->openDialog(true);
+ _theme->openDialog(true, ThemeEngine::kShadingNone);
for (i = 0; i < _dialogStack.size() - 1; i++) {
_dialogStack[i]->drawDialog();
@@ -158,7 +164,7 @@ void GuiManager::redraw() {
case kRedrawOpenDialog:
_theme->updateScreen();
- _theme->openDialog(true, (ThemeEngine::ShadingStyle)xmlEval()->getVar("Dialog." + _dialogStack.top()->_name + ".Shading", 0));
+ _theme->openDialog(true, shading);
_dialogStack.top()->drawDialog();
_theme->finishBuffering();
break;
@@ -370,6 +376,8 @@ void GuiManager::closeTopDialog() {
_dialogStack.pop();
if (_redrawStatus != kRedrawFull)
_redrawStatus = kRedrawCloseDialog;
+
+ redraw();
}
void GuiManager::setupCursor() {
diff --git a/gui/widget.cpp b/gui/widget.cpp
index b93f93656c..478e1d87f4 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -146,10 +146,14 @@ Widget *Widget::findWidgetInChain(Widget *w, const char *name) {
}
void Widget::setEnabled(bool e) {
- if (e)
- setFlags(WIDGET_ENABLED);
- else
- clearFlags(WIDGET_ENABLED);
+ if ((_flags & WIDGET_ENABLED) != e) {
+ if (e)
+ setFlags(WIDGET_ENABLED);
+ else
+ clearFlags(WIDGET_ENABLED);
+
+ _boss->draw();
+ }
}
bool Widget::isEnabled() const {