aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/style.cc9
-rw-r--r--dw/style.hh1
-rw-r--r--dw/widget.cc16
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);
}
/*