aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorVicent Marti2009-01-08 18:09:13 +0000
committerVicent Marti2009-01-08 18:09:13 +0000
commitd638ddd3d6fac6b548aa004e419a819b8a6fc95a (patch)
treea1903b2d14c0f7db65879d360838f15fc5299304 /gui
parent23f23d7491af556c5b04d01bf18972f0dfaa91d3 (diff)
downloadscummvm-rg350-d638ddd3d6fac6b548aa004e419a819b8a6fc95a.tar.gz
scummvm-rg350-d638ddd3d6fac6b548aa004e419a819b8a6fc95a.tar.bz2
scummvm-rg350-d638ddd3d6fac6b548aa004e419a819b8a6fc95a.zip
Fixed release critical bug #2472185. All transparent buttons should now properly refresh their text when changed between redrawing frames. This includes the launcher "Add game" button and the options "subtitle mode" button.
svn-id: r35789
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeEngine.cpp4
-rw-r--r--gui/widget.cpp15
2 files changed, 12 insertions, 7 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 869294142f..9e0820b1c6 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -308,7 +308,7 @@ void ThemeEngine::calcBackgroundOffset(DrawData type) {
}
void ThemeEngine::restoreBackground(Common::Rect r) {
- r.clip(_screen.w, _screen.h); // AHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA... Oh god. :(
+ r.clip(_screen.w, _screen.h);
_vectorRenderer->blitSurface(&_backBuffer, r);
}
@@ -624,7 +624,7 @@ void ThemeEngine::drawButton(const Common::Rect &r, const Common::String &str, W
dd = kDDButtonDisabled;
queueDD(dd, r);
- queueDDText(getTextData(dd), r, str, true, false, _widgets[dd]->_textAlignH, _widgets[dd]->_textAlignV);
+ queueDDText(getTextData(dd), r, str, false, false, _widgets[dd]->_textAlignH, _widgets[dd]->_textAlignV);
}
void ThemeEngine::drawLineSeparator(const Common::Rect &r, WidgetStateInfo state) {
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 995de2fe06..7d6a8c939d 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -199,11 +199,16 @@ void StaticTextWidget::setValue(int value) {
void StaticTextWidget::setLabel(const Common::String &label) {
_label = label;
- // TODO: We should automatically redraw when the label is changed.
- // The following doesn't quite work when we are using tabs, plus it
- // is rather clumsy to force a full redraw for a single static text.
- // However, as long as we do blending, it might be the only way.
- //_boss->draw();
+
+ // get parent's size
+ const uint16 w = _boss->getWidth();
+ const uint16 h = _boss->getHeight();
+ const int16 x = _boss->getAbsX();
+ const int16 y = _boss->getAbsY();
+
+ // restore the parent's background and redraw it again.
+ g_gui.theme()->restoreBackground(Common::Rect(x, y, x + w, y + h));
+ _boss->draw();
}
void StaticTextWidget::setAlign(Graphics::TextAlign align) {