hrev53942 adds 1 changeset to branch 'master'
old head: 9b33a309dab39f04474bc441d8d35e7f402b40ca
new head: 98a8bc858e5a115c5da7b2122b69fd3893abfe69
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=98a8bc858e5a+%5E9b33a309dab3
----------------------------------------------------------------------------
98a8bc858e5a: PowerStatus: Draw battery icon even if there isn't enough space
This allows for drawing the battery icon in Deskbar at 8pt font.
Change-Id: Ibd8f151fe5a16da5f812083a3d5457991b3c49a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2300
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>
[ John Scipione <jscipione@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev53942
Commit: 98a8bc858e5a115c5da7b2122b69fd3893abfe69
URL: https://git.haiku-os.org/haiku/commit/?id=98a8bc858e5a
Author: John Scipione <jscipione@xxxxxxxxx>
Date: Sun Mar 1 19:52:32 2020 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Mar 7 18:12:59 2020 UTC
----------------------------------------------------------------------------
1 file changed, 3 insertions(+), 14 deletions(-)
src/apps/powerstatus/PowerStatusView.cpp | 17 +++--------------
----------------------------------------------------------------------------
diff --git a/src/apps/powerstatus/PowerStatusView.cpp
b/src/apps/powerstatus/PowerStatusView.cpp
index ae5bd53e1f..c3bc6d0c25 100644
--- a/src/apps/powerstatus/PowerStatusView.cpp
+++ b/src/apps/powerstatus/PowerStatusView.cpp
@@ -58,9 +58,6 @@ const uint32 kMsgToggleTime = 'tgtm';
const uint32 kMsgToggleStatusIcon = 'tgsi';
const uint32 kMsgToggleExtInfo = 'texi';
-const uint32 kMinIconWidth = 16;
-const uint32 kMinIconHeight = 16;
-
const int32 kLowBatteryPercentage = 15;
const int32 kNoteBatteryPercentage = 30;
@@ -319,18 +316,10 @@ PowerStatusView::DrawTo(BView* view, BRect rect)
if (fShowStatusIcon) {
iconRect = rect;
- if (showLabel) {
- if (inside == false)
- iconRect.right -= textWidth + 2;
- }
+ if (showLabel && inside == false)
+ iconRect.right -= textWidth + 2;
- if (iconRect.Width() + 1 >= kMinIconWidth
- && iconRect.Height() + 1 >= kMinIconHeight) {
- _DrawBattery(view, iconRect);
- } else {
- // there is not enough space for the icon
- iconRect.Set(0, 0, -1, -1);
- }
+ _DrawBattery(view, iconRect);
}
if (showLabel) {