[haiku-commits] haiku: hrev52137 - src/apps/haikudepot/ui

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 26 Jul 2018 12:28:16 -0400 (EDT)

hrev52137 adds 1 changeset to branch 'master'
old head: fb7812fab0e014ddcd3745869699d1d2671187b7
new head: e5c4ce4f6746cce6ec7c9bd6d69a550832cb5525
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=e5c4ce4f6746+%5Efb7812fab0e0

----------------------------------------------------------------------------

e5c4ce4f6746: HaikuDepot: Fix package list icon size for regular and featured 
views
  
  Fixes #13399
  Change-Id: I9a372d467e2056c6985fdc43b4629aa8fecd7535

                                       [ David Murphy <murphman@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev52137
Commit:      e5c4ce4f6746cce6ec7c9bd6d69a550832cb5525
URL:         https://git.haiku-os.org/haiku/commit/?id=e5c4ce4f6746
Author:      David Murphy <murphman@xxxxxxxxx>
Date:        Sun Jul 22 03:05:24 2018 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Thu Jul 26 16:28:13 2018 UTC

Ticket:      https://dev.haiku-os.org/ticket/13399

----------------------------------------------------------------------------

2 files changed, 9 insertions(+), 3 deletions(-)
src/apps/haikudepot/ui/FeaturedPackagesView.cpp | 3 +++
src/apps/haikudepot/ui/PackageListView.cpp      | 9 ++++++---

----------------------------------------------------------------------------

diff --git a/src/apps/haikudepot/ui/FeaturedPackagesView.cpp 
b/src/apps/haikudepot/ui/FeaturedPackagesView.cpp
index d1ca2e0ee4..afc761e1f5 100644
--- a/src/apps/haikudepot/ui/FeaturedPackagesView.cpp
+++ b/src/apps/haikudepot/ui/FeaturedPackagesView.cpp
@@ -51,7 +51,10 @@ public:
                SetHighUIColor(B_LIST_ITEM_TEXT_COLOR);
                SetEventMask(B_POINTER_EVENTS);
 
+               // Featured icon package should be scaled to 64x64
                fIconView = new BitmapView("package icon view");
+               fIconView->SetExplicitMinSize(BSize(64, 64));
+
                fInstalledIconView = new BitmapView("installed icon view");
                fTitleView = new BStringView("package title view", "");
                fPublisherView = new BStringView("package publisher view", "");
diff --git a/src/apps/haikudepot/ui/PackageListView.cpp 
b/src/apps/haikudepot/ui/PackageListView.cpp
index bcdbf7e101..e924639d1b 100644
--- a/src/apps/haikudepot/ui/PackageListView.cpp
+++ b/src/apps/haikudepot/ui/PackageListView.cpp
@@ -331,10 +331,12 @@ PackageColumn::DrawField(BField* field, BRect rect, 
BView* parent)
        if (bitmapField != NULL) {
                const BBitmap* bitmap = bitmapField->Bitmap();
 
+               // Scale the bitmap to 16x16
+               BRect r = BRect(0, 0, 15, 15);
+
                // figure out the placement
                float x = 0.0;
-               BRect r = bitmap ? bitmap->Bounds() : BRect(0, 0, 15, 15);
-               float y = rect.top + ((rect.Height() - r.Height()) / 2);
+               float y = rect.top + ((rect.Height() - r.Height()) / 2) - 1;
                float width = 0.0;
 
                switch (Alignment()) {
@@ -363,7 +365,8 @@ PackageColumn::DrawField(BField* field, BRect rect, BView* 
parent)
                // draw the bitmap
                if (bitmap != NULL) {
                        parent->SetDrawingMode(B_OP_ALPHA);
-                       parent->DrawBitmap(bitmap, BPoint(x, y));
+                       BRect viewRect(x, y, x + 16, y + 16);
+                       parent->DrawBitmap(bitmap, bitmap->Bounds(), viewRect);
                        parent->SetDrawingMode(B_OP_OVER);
                }
 


Other related posts:

  • » [haiku-commits] haiku: hrev52137 - src/apps/haikudepot/ui - waddlesplash