diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-05-28 20:48:21 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-05-28 20:48:21 +0200 |
commit | b0b0cddaff10b4cff371b8bb7aa21e045f8e3915 (patch) | |
tree | 10f178f4d8cb6ad5b80cba3590d9dc0107027655 /dw/layout.cc | |
parent | 1351b8d80044b898f92557e7ff90096deee5f5bc (diff) | |
parent | b99998a37d3ab1336d0ce82ddc60d0c406a2fd1b (diff) |
merge
Diffstat (limited to 'dw/layout.cc')
-rw-r--r-- | dw/layout.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/dw/layout.cc b/dw/layout.cc index d8b96d55..8f67e895 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -223,7 +223,8 @@ Layout::~Layout () platform->removeIdle (scrollIdleId); if (resizeIdleId != -1) platform->removeIdle (resizeIdleId); - + if (bgColor) + bgColor->unref (); if (topLevel) delete topLevel; delete platform; @@ -247,7 +248,6 @@ void Layout::addWidget (Widget *widget) canvasHeightGreater = false; setSizeHints (); - updateBgColor (); queueResize (); } @@ -610,17 +610,17 @@ 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; - view->setBgColor (bgColor); + color->ref (); + + if (bgColor) + bgColor->unref (); + + bgColor = color; + + if (view) + view->setBgColor (bgColor); } void Layout::resizeIdle () |