HaikuDepot: Fix Icon Backgrounds

Some icons are not correctly observing the color
of the background view they are drawing on.  This
commit will fix that problem.

Resolves #14587

Change-Id: Icdd3eda915c985eba3517f888f29ccb2f8278487
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2500
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Andrew Lindesay
2020-04-19 22:24:04 +00:00
committed by waddlesplash
parent 55e10d7ca4
commit 30bd2c8c29
2 changed files with 6 additions and 22 deletions
+4 -16
View File
@@ -1,5 +1,6 @@
/* /*
* Copyright 2013, Stephan Aßmus <[email protected]>. * Copyright 2013, Stephan Aßmus <[email protected]>.
* Copyright 2020, Andrew Lindesay <[email protected]>.
* All rights reserved. Distributed under the terms of the MIT License. * All rights reserved. Distributed under the terms of the MIT License.
*/ */
@@ -14,10 +15,12 @@
BitmapView::BitmapView(const char* name) BitmapView::BitmapView(const char* name)
: :
BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE), BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE
| B_TRANSPARENT_BACKGROUND),
fBitmap(NULL), fBitmap(NULL),
fScaleBitmap(true) fScaleBitmap(true)
{ {
SetViewColor(B_TRANSPARENT_COLOR);
} }
@@ -26,18 +29,10 @@ BitmapView::~BitmapView()
} }
void
BitmapView::AllAttached()
{
AdoptParentColors();
}
void void
BitmapView::Draw(BRect updateRect) BitmapView::Draw(BRect updateRect)
{ {
BRect bounds(Bounds()); BRect bounds(Bounds());
DrawBackground(bounds, updateRect);
if (fBitmap == NULL) if (fBitmap == NULL)
return; return;
@@ -166,10 +161,3 @@ BitmapView::SetScaleBitmap(bool scaleBitmap)
Invalidate(); Invalidate();
} }
void
BitmapView::DrawBackground(BRect& bounds, BRect updateRect)
{
FillRect(updateRect, B_SOLID_LOW);
}
+1 -5
View File
@@ -1,5 +1,6 @@
/* /*
* Copyright 2013, Stephan Aßmus <[email protected]>. * Copyright 2013, Stephan Aßmus <[email protected]>.
* Copyright 2020, Andrew Lindesay <[email protected]>.
* All rights reserved. Distributed under the terms of the MIT License. * All rights reserved. Distributed under the terms of the MIT License.
*/ */
#ifndef BITMAP_VIEW_H #ifndef BITMAP_VIEW_H
@@ -17,7 +18,6 @@ public:
virtual ~BitmapView(); virtual ~BitmapView();
virtual void AllAttached();
virtual void Draw(BRect updateRect); virtual void Draw(BRect updateRect);
virtual BSize MinSize(); virtual BSize MinSize();
@@ -30,10 +30,6 @@ public:
void UnsetBitmap(); void UnsetBitmap();
void SetScaleBitmap(bool scaleBitmap); void SetScaleBitmap(bool scaleBitmap);
protected:
virtual void DrawBackground(BRect& bounds,
BRect updateRect);
private: private:
BitmapRef fReference; BitmapRef fReference;
SharedBitmap::Size fBitmapSize; SharedBitmap::Size fBitmapSize;