aboutsummaryrefslogtreecommitdiff
path: root/dw/widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/widget.cc')
-rw-r--r--dw/widget.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/dw/widget.cc b/dw/widget.cc
index 751cdcdf..cc73b32b 100644
--- a/dw/widget.cc
+++ b/dw/widget.cc
@@ -294,18 +294,17 @@ void Widget::setStyle (style::Style *style)
{
bool sizeChanged;
+ style->ref ();
+
if (this->style) {
sizeChanged = this->style->sizeDiffs (style);
this->style->unref ();
} else
sizeChanged = true;
- style->ref ();
this->style = style;
if (layout != NULL) {
- if (parent == NULL)
- layout->updateBgColor ();
layout->updateCursor ();
}
@@ -341,9 +340,7 @@ style::Color *Widget::getBgColor ()
widget = widget->parent;
}
- MSG_WARN("No background color found!\n");
- return NULL;
-
+ return layout->getBgColor ();
}
@@ -401,7 +398,9 @@ void Widget::drawWidgetBox (View *view, Rectangle *area, bool inverse)
* widget->style->background_color is NULL (shining through).
*/
/** \todo Background images? */
- if (parent && style->backgroundColor)
+
+ if (style->backgroundColor &&
+ (parent || layout->getBgColor () != style->backgroundColor))
style::drawBackground (view, &viewArea, allocation.x, allocation.y,
allocation.width, getHeight (), style, inverse);
}