diff options
author | Sebastian Geerken <devnull@localhost> | 2013-09-12 20:19:27 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-09-12 20:19:27 +0200 |
commit | 76a23c134dfd1d98923830b35a9ee630924b2250 (patch) | |
tree | 6ad58d098a844dbf3696c749a2728f9b2df26e3e | |
parent | 3599a4762e8a62c0c8c32f0e9d9ec3e37730d271 (diff) |
Some clarifications.
-rw-r--r-- | dw/style.cc | 9 | ||||
-rw-r--r-- | dw/style.hh | 1 | ||||
-rw-r--r-- | dw/widget.cc | 16 |
3 files changed, 23 insertions, 3 deletions
diff --git a/dw/style.cc b/dw/style.cc index 373ffa8d..4409bb43 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -868,6 +868,9 @@ static void drawBorderRight(View *view, Style *style, * \brief Draw the border of a region in window, according to style. * * Used by dw::core::Widget::drawBox and dw::core::Widget::drawWidgetBox. + * + * "area" is the area to be drawn, "x", "y", "width" and "height" + * define the box itself. All are given in canvas coordinates. */ void drawBorder (View *view, Layout *layout, Rectangle *area, int x, int y, int width, int height, @@ -907,6 +910,11 @@ void drawBorder (View *view, Layout *layout, Rectangle *area, * * Used by dw::core::Widget::drawBox and dw::core::Widget::drawWidgetBox. * + * "area" is the area to be drawn, "x", "y", "width" and "height" + * define the box itself. "xRef", "yRef", "widthRef" and "heightRef" + * define the reference area, which is important for background + * images. All are given in canvas coordinates. + * * "atTop" should be true, only if the area is drawn directly on the * canvas, not on top of other areas; this is only true for the * toplevel widget itself (not parts of its contents). Toplevel widget @@ -919,6 +927,7 @@ void drawBorder (View *view, Layout *layout, Rectangle *area, */ void drawBackground (View *view, Layout *layout, Rectangle *area, int x, int y, int width, int height, + int xRef, int yRef, int widthRef, int heightRef, Style *style, bool inverse, bool atTop) { bool bgColor = style->backgroundColor != NULL && diff --git a/dw/style.hh b/dw/style.hh index 187cd6be..6c82be8d 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -722,6 +722,7 @@ void drawBorder (View *view, Layout *layout, Rectangle *area, Style *style, bool inverse); void drawBackground (View *view, Layout *layout, Rectangle *area, int x, int y, int width, int height, + int xRef, int yRef, int widthRef, int heightRef, Style *style, bool inverse, bool atTop); void numtostr (int num, char *buf, int buflen, ListStyleType listStyleType); diff --git a/dw/widget.cc b/dw/widget.cc index 31c69f4c..766d2500 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -350,9 +350,14 @@ void Widget::drawBox (View *view, style::Style *style, Rectangle *area, allocation.x + x, allocation.y + y, width, height, style, inverse); + /** + * \todo Reference should be the containing block (which will be + * introduced later), not the widget allocation. + */ style::drawBackground (view, layout, &canvasArea, allocation.x + x, allocation.y + y, width, height, - style, inverse, false); + allocation.x, allocation.y, allocation.width, + getHeight (), style, inverse, false); } /** @@ -372,9 +377,14 @@ void Widget::drawWidgetBox (View *view, Rectangle *area, bool inverse) style::drawBorder (view, layout, &canvasArea, allocation.x, allocation.y, allocation.width, getHeight (), style, inverse); + /** + * \todo Reference should be the containing block (which will be + * introduced later), not the widget allocation. + */ style::drawBackground (view, layout, &canvasArea, allocation.x, allocation.y, - allocation.width, getHeight (), style, inverse, - parent == NULL); + allocation.width, getHeight (), allocation.x, + allocation.y, allocation.width, getHeight (), + style, inverse, parent == NULL); } /* |