From 9d075c91a091816d401109ece6c331f3fd8dd223 Mon Sep 17 00:00:00 2001 From: plfiorini Date: Sun, 30 May 2010 04:24:53 +0000 Subject: [PATCH] Set view color to parent's view color. No more glitches when bitmap is not set. --- libs/libinterface/BitmapView.cpp | 10 ++++++++-- libs/libinterface/BitmapView.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/libinterface/BitmapView.cpp b/libs/libinterface/BitmapView.cpp index c1f55e9..6210e64 100644 --- a/libs/libinterface/BitmapView.cpp +++ b/libs/libinterface/BitmapView.cpp @@ -23,8 +23,6 @@ BitmapView::BitmapView(const char* name, uint32 flags) fWidth(kMinWidth), fHeight(kMinHeight) { - // Set transparent view color - SetViewColor(B_TRANSPARENT_COLOR); } @@ -35,6 +33,14 @@ BitmapView::~BitmapView() } +void +BitmapView::AttachedToWindow() +{ + // Set view color to parent's view color + SetViewColor(Parent()->ViewColor()); +} + + status_t BitmapView::InitCheck() { diff --git a/libs/libinterface/BitmapView.h b/libs/libinterface/BitmapView.h index b8fb44d..5b1abba 100644 --- a/libs/libinterface/BitmapView.h +++ b/libs/libinterface/BitmapView.h @@ -15,6 +15,8 @@ public: = B_WILL_DRAW); ~BitmapView(); + virtual void AttachedToWindow(); + status_t InitCheck(); BBitmap* Bitmap() const;