From 4f2fc580b80f2eca54c5ba415aa778d27789a31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 19 Jul 2008 17:49:45 +0000 Subject: [PATCH] The BStringView is not a BControl but suffered from the same problem in AttachedToWindow(). Maybe there are more non-BControls yet, I didn't have a look. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26511 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/StringView.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/StringView.cpp b/src/kits/interface/StringView.cpp index 1aecc0e4b7..1eee366911 100644 --- a/src/kits/interface/StringView.cpp +++ b/src/kits/interface/StringView.cpp @@ -131,8 +131,16 @@ BStringView::Alignment() const void BStringView::AttachedToWindow() { - if (Parent()) - SetViewColor(Parent()->ViewColor()); + rgb_color color = B_TRANSPARENT_COLOR; + + BView* parent = Parent(); + if (parent != NULL) + color = parent->ViewColor(); + + if (color == B_TRANSPARENT_COLOR) + color = ui_color(B_PANEL_BACKGROUND_COLOR); + + SetViewColor(color); }