aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r--gui/widget.cpp15
1 files changed, 10 insertions, 5 deletions
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) {