aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.cpp
diff options
context:
space:
mode:
authorMax Horn2002-07-10 16:49:45 +0000
committerMax Horn2002-07-10 16:49:45 +0000
commitd32e3ad11f8f5e73b9a72cdaa003d8b66211172c (patch)
tree1e1c2c8dda75fe6a08e23acc620bf08c5dc2cdc3 /gui/widget.cpp
parent5cc6e3f6a037453193aac1ee6a18771f962ad653 (diff)
downloadscummvm-rg350-d32e3ad11f8f5e73b9a72cdaa003d8b66211172c.tar.gz
scummvm-rg350-d32e3ad11f8f5e73b9a72cdaa003d8b66211172c.tar.bz2
scummvm-rg350-d32e3ad11f8f5e73b9a72cdaa003d8b66211172c.zip
improved the alpha blending code, now works properly for nesting/redraw (changed meaning of WIDGET_CLEARBG a little bit for this)
svn-id: r4509
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r--gui/widget.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 510eb8428b..bf45fb522f 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -43,8 +43,8 @@ void Widget::draw()
_x += _boss->_x;
_y += _boss->_y;
- // Clear background
- if (_flags & WIDGET_CLEARBG)
+ // Clear background (unless alpha blending is enabled)
+ if (_flags & WIDGET_CLEARBG && !_boss->_screenBuf)
gui->fillArea(_x, _y, _w, _h, gui->_bgcolor);
// Draw border
@@ -94,7 +94,7 @@ void StaticTextWidget::drawWidget(bool hilite)
ButtonWidget::ButtonWidget(Dialog *boss, int x, int y, int w, int h, const char *label, uint32 cmd, uint8 hotkey)
: StaticTextWidget(boss, x, y, w, h, label), _cmd(cmd), _hotkey(hotkey)
{
- _flags = WIDGET_ENABLED | WIDGET_BORDER /* | WIDGET_CLEARBG */ ;
+ _flags = WIDGET_ENABLED | WIDGET_BORDER | WIDGET_CLEARBG ;
_type = kButtonWidget;
}
@@ -148,7 +148,7 @@ void CheckboxWidget::drawWidget(bool hilite)
if (_state)
gui->drawBitmap(checked_img, _x + 3, _y + 3, gui->_textcolor);
else
- gui->fillArea(_x + 3, _y + 3, 8, 8, gui->_bgcolor);
+ gui->fillArea(_x + 2, _y + 2, 10, 10, gui->_bgcolor);
// Finally draw the label
gui->drawString(_text, _x + 20, _y + 3, _w, gui->_textcolor);
@@ -159,7 +159,7 @@ void CheckboxWidget::drawWidget(bool hilite)
SliderWidget::SliderWidget(Dialog *boss, int x, int y, int w, int h, const char *label, uint32 cmd, uint8 hotkey)
: ButtonWidget(boss, x, y, w, h, label, cmd, hotkey), _value(0), _old_value(1)
{
- _flags = WIDGET_ENABLED | WIDGET_TRACK_MOUSE;
+ _flags = WIDGET_ENABLED | WIDGET_TRACK_MOUSE | WIDGET_CLEARBG;
_type = kSliderWidget;
}