diff options
author | Sebastian Geerken <devnull@localhost> | 2014-11-08 14:57:16 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-11-08 14:57:16 +0100 |
commit | aa4f6269918fcfc5ebd11d3b712e88577773ba02 (patch) | |
tree | 9e914def2dc344a71c266f4361123abcbde88cba /dw/widget.cc | |
parent | faa8d1b65d9f724445e068d2766356103204728a (diff) | |
parent | 550d933b21d548411fe862d6a24ce73e4d5621c5 (diff) |
Merge with main repo.
Diffstat (limited to 'dw/widget.cc')
-rw-r--r-- | dw/widget.cc | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/dw/widget.cc b/dw/widget.cc index 4c1fb896..9c517f24 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -1422,6 +1422,10 @@ void Widget::drawBox (View *view, style::Style *style, Rectangle *area, // does not define what here is called "reference area". To make it look // smoothly, the widget padding box is used. + // TODO Handle inverse drawing the same way as in drawWidgetBox? + // Maybe this method (drawBox) is anyway obsolete when extraSpace + // is fully supported (as here, in the "dillo_grows" repository). + int xPad, yPad, widthPad, heightPad; getPaddingArea (&xPad, &yPad, &widthPad, &heightPad); style::drawBackground @@ -1432,7 +1436,8 @@ void Widget::drawBox (View *view, style::Style *style, Rectangle *area, - style->margin.right - style->borderWidth.right, height - style->margin.top - style->borderWidth.top - style->margin.bottom - style->borderWidth.bottom, - xPad, yPad, widthPad, heightPad, style, inverse, false); + xPad, yPad, widthPad, heightPad, style, style->backgroundColor, + inverse, false); } /** @@ -1456,10 +1461,26 @@ void Widget::drawWidgetBox (View *view, Rectangle *area, bool inverse) int xPad, yPad, widthPad, heightPad; getPaddingArea (&xPad, &yPad, &widthPad, &heightPad); + + style::Color *bgColor; + if (inverse && style->backgroundColor == NULL) { + // See style::drawBackground: for inverse drawing, we need a + // defined background color. Search through ancestors. + Widget *w = this; + while (w != NULL && w->style->backgroundColor == NULL) + w = w->parent; + + if (w != NULL && w->style->backgroundColor != NULL) + bgColor = w->style->backgroundColor; + else + bgColor = layout->getBgColor (); + } else + bgColor = style->backgroundColor; + style::drawBackground (view, layout, &canvasArea, xPad, yPad, widthPad, heightPad, xPad, yPad, widthPad, heightPad, - style, inverse, parent == NULL); + style, bgColor, inverse, parent == NULL); } /* |