diff --git a/src/apps/launchbox/IconButton.cpp b/src/apps/launchbox/IconButton.cpp index ae21bdfd6a..85eaf35407 100644 --- a/src/apps/launchbox/IconButton.cpp +++ b/src/apps/launchbox/IconButton.cpp @@ -69,6 +69,16 @@ IconButton::MessageReceived(BMessage* message) void IconButton::AttachedToWindow() { + rgb_color background = B_TRANSPARENT_COLOR; + if (BView* parent = Parent()) { + background = parent->ViewColor(); + if (background == B_TRANSPARENT_COLOR) + background = parent->LowColor(); + } + if (background == B_TRANSPARENT_COLOR) + background = ui_color(B_PANEL_BACKGROUND_COLOR); + SetLowColor(background); + SetTarget(fTargetCache); if (!Target()) SetTarget(Window()); @@ -79,8 +89,6 @@ void IconButton::Draw(BRect area) { rgb_color background = LowColor(); - if (BView* parent = Parent()) - background = parent->LowColor(); BRect r(Bounds());