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:
committed by
waddlesplash
parent
55e10d7ca4
commit
30bd2c8c29
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2013, Stephan Aßmus <[email protected]>.
|
||||
* Copyright 2020, Andrew Lindesay <[email protected]>.
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
@@ -14,10 +15,12 @@
|
||||
|
||||
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),
|
||||
fScaleBitmap(true)
|
||||
{
|
||||
SetViewColor(B_TRANSPARENT_COLOR);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,18 +29,10 @@ BitmapView::~BitmapView()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BitmapView::AllAttached()
|
||||
{
|
||||
AdoptParentColors();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BitmapView::Draw(BRect updateRect)
|
||||
{
|
||||
BRect bounds(Bounds());
|
||||
DrawBackground(bounds, updateRect);
|
||||
|
||||
if (fBitmap == NULL)
|
||||
return;
|
||||
@@ -165,11 +160,4 @@ BitmapView::SetScaleBitmap(bool scaleBitmap)
|
||||
fScaleBitmap = scaleBitmap;
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BitmapView::DrawBackground(BRect& bounds, BRect updateRect)
|
||||
{
|
||||
FillRect(updateRect, B_SOLID_LOW);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2013, Stephan Aßmus <[email protected]>.
|
||||
* Copyright 2020, Andrew Lindesay <[email protected]>.
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef BITMAP_VIEW_H
|
||||
@@ -17,7 +18,6 @@ public:
|
||||
|
||||
virtual ~BitmapView();
|
||||
|
||||
virtual void AllAttached();
|
||||
virtual void Draw(BRect updateRect);
|
||||
|
||||
virtual BSize MinSize();
|
||||
@@ -30,10 +30,6 @@ public:
|
||||
void UnsetBitmap();
|
||||
void SetScaleBitmap(bool scaleBitmap);
|
||||
|
||||
protected:
|
||||
virtual void DrawBackground(BRect& bounds,
|
||||
BRect updateRect);
|
||||
|
||||
private:
|
||||
BitmapRef fReference;
|
||||
SharedBitmap::Size fBitmapSize;
|
||||
|
||||
Reference in New Issue
Block a user