- 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
This commit is contained in:
Johannes Schickel 2006-06-15 14:25:59 +00:00
parent 4a1b8ccb86
commit 84b54c3173
4 changed files with 12 additions and 4 deletions

View File

@ -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() {

View File

@ -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

View File

@ -148,6 +148,8 @@ void NewGui::redraw() {
_dialogStack[i]->drawDialog();
}
_theme->drawAll();
}
void NewGui::runLoop() {

View File

@ -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
};