diff options
author | Johannes Schickel | 2006-06-15 14:25:59 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-06-15 14:25:59 +0000 |
commit | 84b54c31732538464ee8d75644a0587aa32ff5f5 (patch) | |
tree | a526521d2817a8cc994fd4c00450214e023439e6 | |
parent | 4a1b8ccb86426b437f6ddb13bde3b11abb688d14 (diff) | |
download | scummvm-rg350-84b54c31732538464ee8d75644a0587aa32ff5f5.tar.gz scummvm-rg350-84b54c31732538464ee8d75644a0587aa32ff5f5.tar.bz2 scummvm-rg350-84b54c31732538464ee8d75644a0587aa32ff5f5.zip |
- Adds 'THEME_HINT_NO_BACKGROUND_RESTORE' for buttons which don't want restored background (example: the tab scrolling buttons).
- Call _theme->drawAll() at the end of the redraw method of NewGui
svn-id: r23134
-rw-r--r-- | gui/TabWidget.cpp | 4 | ||||
-rw-r--r-- | gui/ThemeNew.cpp | 2 | ||||
-rw-r--r-- | gui/newgui.cpp | 2 | ||||
-rw-r--r-- | gui/theme.h | 8 |
4 files changed, 12 insertions, 4 deletions
diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp index c57c3b2aca..32ed29dfc0 100644 --- a/gui/TabWidget.cpp +++ b/gui/TabWidget.cpp @@ -65,9 +65,9 @@ void TabWidget::init() { int x = _w - _butRP - _butW * 2 - 2; int y = _butTP - _tabHeight; _navLeft = new ButtonWidget(this, x, y, _butW, _butH, "<", kCmdLeft, 0); - _navLeft->clearHints(THEME_HINT_SAVE_BACKGROUND); + _navLeft->setHints(THEME_HINT_NO_BACKGROUND_RESTORE); _navRight = new ButtonWidget(this, x + _butW + 2, y, _butW, _butH, ">", kCmdRight, 0); - _navRight->clearHints(THEME_HINT_SAVE_BACKGROUND); + _navRight->setHints(THEME_HINT_NO_BACKGROUND_RESTORE); } TabWidget::~TabWidget() { diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp index c02ff2e1d9..b7c509c0b2 100644 --- a/gui/ThemeNew.cpp +++ b/gui/ThemeNew.cpp @@ -400,7 +400,7 @@ void ThemeNew::drawButton(const Common::Rect &r, const Common::String &str, Stat Common::Rect r2 = shadowRect(r, kShadowButton); - if (hints & THEME_HINT_SAVE_BACKGROUND) + if (!(hints & THEME_HINT_NO_BACKGROUND_RESTORE) || state == kStateDisabled) restoreBackground(r2); // shadow diff --git a/gui/newgui.cpp b/gui/newgui.cpp index f4ec342925..57c23e35e2 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -148,6 +148,8 @@ void NewGui::redraw() { _dialogStack[i]->drawDialog(); } + + _theme->drawAll(); } void NewGui::runLoop() { diff --git a/gui/theme.h b/gui/theme.h index 2fd43e98bc..db706a35a7 100644 --- a/gui/theme.h +++ b/gui/theme.h @@ -59,7 +59,13 @@ enum { THEME_HINT_PLAIN_COLOR = 1 << 4, // Indictaes that a shadows should be drawn around the background - THEME_HINT_USE_SHADOW = 1 << 5 + THEME_HINT_USE_SHADOW = 1 << 5, + + // Indicates that no background should be restored when drawing the widget + // (note that this can be silently ignored if for example the theme does + // alpha blending and would blend over a allready drawn widget) + // TODO: currently only ThemeNew::drawButton supports this + THEME_HINT_NO_BACKGROUND_RESTORE = 1 << 6 }; |