* BControl::AttachedToWindow() now also sets the background color to

B_PANEL_BACKGROUND_COLOR if there is no parent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31969 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-07-30 14:06:21 +00:00
parent 617ebd8897
commit 3a81656554
+7 -4
View File
@@ -144,16 +144,19 @@ BControl::WindowActivated(bool active)
void
BControl::AttachedToWindow()
{
rgb_color color;
BView* parent = Parent();
if (parent != NULL) {
// inherit the color from parent
rgb_color color = parent->ViewColor();
color = parent->ViewColor();
if (color == B_TRANSPARENT_COLOR)
color = ui_color(B_PANEL_BACKGROUND_COLOR);
} else
color = ui_color(B_PANEL_BACKGROUND_COLOR);
SetViewColor(color);
SetLowColor(color);
}
SetViewColor(color);
SetLowColor(color);
if (!Messenger().IsValid())
SetTarget(Window());