From c62a389196c25c864358cefb34a5bca5f778d3d4 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sat, 21 Oct 2017 19:13:55 -0700 Subject: [PATCH] PowerStatus: Make battery 16x16 in Deskbar Frame was a bit wider than it needed to be to fit, battery is same size as before. Moved the lightning right 1px and down 1px to fit better expands to show battery percentage more compactly as well. --- src/apps/powerstatus/PowerStatusView.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/apps/powerstatus/PowerStatusView.cpp b/src/apps/powerstatus/PowerStatusView.cpp index a13edc3375..31ff712423 100644 --- a/src/apps/powerstatus/PowerStatusView.cpp +++ b/src/apps/powerstatus/PowerStatusView.cpp @@ -241,12 +241,12 @@ PowerStatusView::_DrawBattery(BRect rect) SetScale(std::min(Bounds().Width(), Bounds().Height()) / 16); static const BPoint points[] = { - BPoint(2, 13), - BPoint(9, 5), - BPoint(9, 7), - BPoint(16, 2), - BPoint(8, 11), - BPoint(8, 9) + BPoint(3, 14), + BPoint(10, 6), + BPoint(10, 8), + BPoint(17, 3), + BPoint(9, 12), + BPoint(9, 10) }; FillPolygon(points, 6); @@ -286,9 +286,9 @@ PowerStatusView::Draw(BRect updateRect) iconRect = Bounds(); if (showLabel) { if (below) - iconRect.bottom -= textHeight + 4; + iconRect.bottom -= textHeight + 2; else - iconRect.right -= textWidth + 4; + iconRect.right -= textWidth + 2; } // make a square @@ -395,15 +395,15 @@ PowerStatusView::Update(bool force) } if (fInDeskbar) { - // make sure the tray icon is large enough - float width = fShowStatusIcon ? kMinIconWidth + 2 : 0; + // make sure the tray icon is (just) large enough + float width = fShowStatusIcon ? kMinIconWidth - 1 : 0; if (fShowLabel) { char text[64]; _SetLabel(text, sizeof(text)); if (text[0]) - width += ceilf(StringWidth(text)) + 4; + width += ceilf(StringWidth(text)) + 2; } else { char text[256]; const char* open = ""; @@ -435,7 +435,7 @@ PowerStatusView::Update(bool force) strcpy(text, B_TRANSLATE("no battery")); SetToolTip(text); } - if (width == 0) { + if (width < 8) { // make sure we're not going away completely width = 8; }