Pass in 128 as an icon_size to GetTrackerIcon(), this makes it grab a nice 128x128 HVIF icon

This commit is contained in:
John Scipione
2012-11-12 23:57:28 -05:00
parent 12a9a71db6
commit a792461b21
+7 -7
View File
@@ -81,9 +81,9 @@ StripeView::StripeView(BBitmap* icon)
BView("StripeView", B_WILL_DRAW), BView("StripeView", B_WILL_DRAW),
fIcon(icon) fIcon(icon)
{ {
float width = 48.0f; float width = 0.0f;
if (icon != NULL) if (icon != NULL)
width += icon->Bounds().Width() - 16.0f; width += icon->Bounds().Width() + 32.0f;
SetExplicitMinSize(BSize(width, B_SIZE_UNSET)); SetExplicitMinSize(BSize(width, B_SIZE_UNSET));
SetExplicitPreferredSize(BSize(width, B_SIZE_UNLIMITED)); SetExplicitPreferredSize(BSize(width, B_SIZE_UNLIMITED));
@@ -99,6 +99,9 @@ StripeView::~StripeView()
void void
StripeView::Draw(BRect updateRect) StripeView::Draw(BRect updateRect)
{ {
if (fIcon == NULL)
return;
SetHighColor(ViewColor()); SetHighColor(ViewColor());
FillRect(updateRect); FillRect(updateRect);
@@ -107,9 +110,6 @@ StripeView::Draw(BRect updateRect)
SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT)); SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT));
FillRect(stripeRect); FillRect(stripeRect);
if (fIcon == NULL)
return;
SetDrawingMode(B_OP_ALPHA); SetDrawingMode(B_OP_ALPHA);
SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
DrawBitmapAsync(fIcon, BPoint(15.0, 5.0)); DrawBitmapAsync(fIcon, BPoint(15.0, 5.0));
@@ -213,7 +213,7 @@ AboutView::AppIcon(const char* signature)
return NULL; return NULL;
BBitmap* icon = new BBitmap(BRect(0.0, 0.0, 127.0, 127.0), B_RGBA32); BBitmap* icon = new BBitmap(BRect(0.0, 0.0, 127.0, 127.0), B_RGBA32);
if (BNodeInfo::GetTrackerIcon(&ref, icon) == B_OK) if (BNodeInfo::GetTrackerIcon(&ref, icon, (icon_size)128) == B_OK)
return icon; return icon;
delete icon; delete icon;
@@ -225,7 +225,7 @@ AboutView::AppIcon(const char* signature)
BAboutWindow::BAboutWindow(BHandler* handler, const char* appName, const char* signature) BAboutWindow::BAboutWindow(BHandler* handler, const char* appName, const char* signature)
: BWindow(BRect(0.0, 0.0, 310.0, 140.0), appName, B_TITLED_WINDOW, : BWindow(BRect(0.0, 0.0, 200.0, 140.0), appName, B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE
| B_AUTO_UPDATE_SIZE_LIMITS), | B_AUTO_UPDATE_SIZE_LIMITS),
fCaller(handler) fCaller(handler)