summaryrefslogtreecommitdiff
path: root/dw/layout.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-09-17 21:42:31 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-09-17 21:42:31 +0200
commit4fc467bb9112d4e49cc9ecbde03aa72bd805fc6d (patch)
tree522588524950ab2501a94449145806bfd54b75cc /dw/layout.cc
parent6dc060d999d0c76175b535db2f81b7bc4e64c3f5 (diff)
directly set background color
As defined in http://www.w3.org/TR/CSS2/colors.html, the background color of the canvas can either be defined by the <html> or the <body> tag. To be able to deal with this in src/html.cc we now explicitely set the canvas color instead of infering it from the root widget.
Diffstat (limited to 'dw/layout.cc')
-rw-r--r--dw/layout.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/dw/layout.cc b/dw/layout.cc
index b30831c7..f3ff896e 100644
--- a/dw/layout.cc
+++ b/dw/layout.cc
@@ -246,7 +246,6 @@ void Layout::addWidget (Widget *widget)
canvasHeightGreater = false;
setSizeHints ();
- updateBgColor ();
queueResize ();
}
@@ -609,16 +608,9 @@ void Layout::updateCursor ()
setCursor (style::CURSOR_DEFAULT);
}
-void Layout::updateBgColor ()
+void Layout::setBgColor (style::Color *color)
{
- /* The toplevel widget should always have a defined background color,
- * except at the beginning. Searching a defined background is not
- * necessary. */
- if (topLevel && topLevel->getStyle() &&
- topLevel->getStyle()->backgroundColor)
- bgColor = topLevel->getStyle()->backgroundColor;
- else
- bgColor = NULL;
+ bgColor = color;
view->setBgColor (bgColor);
}