From Andrew Lindesay <apl@xxxxxxxxxxxxxx>:
Andrew Lindesay has uploaded this change for review. (
https://review.haiku-os.org/c/haiku/+/2500 ;)
Change subject: HaikuDepot: Fix Icon Backgrounds
......................................................................
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
---
M src/apps/haikudepot/ui_generic/BitmapView.cpp
M src/apps/haikudepot/ui_generic/BitmapView.h
2 files changed, 6 insertions(+), 22 deletions(-)
git pull ssh://git.haiku-os.org:22/haiku refs/changes/00/2500/1
diff --git a/src/apps/haikudepot/ui_generic/BitmapView.cpp
b/src/apps/haikudepot/ui_generic/BitmapView.cpp
index 9eab1a8..ccdeab1 100644
--- a/src/apps/haikudepot/ui_generic/BitmapView.cpp
+++ b/src/apps/haikudepot/ui_generic/BitmapView.cpp
@@ -1,5 +1,6 @@
/*
* Copyright 2013, Stephan Aßmus <superstippi@xxxxxx>.
+ * Copyright 2020, Andrew Lindesay <apl@xxxxxxxxxxxxxx>.
* 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);
}
@@ -27,17 +30,9 @@
void
-BitmapView::AllAttached()
-{
- AdoptParentColors();
-}
-
-
-void
BitmapView::Draw(BRect updateRect)
{
BRect bounds(Bounds());
- DrawBackground(bounds, updateRect);
if (fBitmap == NULL)
return;
@@ -165,11 +160,4 @@
fScaleBitmap = scaleBitmap;
Invalidate();
-}
-
-
-void
-BitmapView::DrawBackground(BRect& bounds, BRect updateRect)
-{
- FillRect(updateRect, B_SOLID_LOW);
-}
+}
\ No newline at end of file
diff --git a/src/apps/haikudepot/ui_generic/BitmapView.h
b/src/apps/haikudepot/ui_generic/BitmapView.h
index d2a706c..1178136 100644
--- a/src/apps/haikudepot/ui_generic/BitmapView.h
+++ b/src/apps/haikudepot/ui_generic/BitmapView.h
@@ -1,5 +1,6 @@
/*
* Copyright 2013, Stephan Aßmus <superstippi@xxxxxx>.
+ * Copyright 2020, Andrew Lindesay <apl@xxxxxxxxxxxxxx>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef BITMAP_VIEW_H
@@ -17,7 +18,6 @@
virtual ~BitmapView();
- virtual void AllAttached();
virtual void Draw(BRect updateRect);
virtual BSize MinSize();
@@ -30,10 +30,6 @@
void UnsetBitmap();
void SetScaleBitmap(bool
scaleBitmap);
-protected:
- virtual void DrawBackground(BRect& bounds,
- BRect
updateRect);
-
private:
BitmapRef fReference;
SharedBitmap::Size fBitmapSize;
--
To view, visit https://review.haiku-os.org/c/haiku/+/2500
To unsubscribe, or for help writing mail filters, visit
https://review.haiku-os.org/settings
Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Icdd3eda915c985eba3517f888f29ccb2f8278487
Gerrit-Change-Number: 2500
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Lindesay <apl@xxxxxxxxxxxxxx>
Gerrit-MessageType: newchange