Bug 301753 - Icon in the battery popup broken with 10% battery left
Summary: Icon in the battery popup broken with 10% battery left
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Unmaintained
Component: widget-battery (show other bugs)
Version: 4.8.80 (beta1)
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-06-12 17:45 UTC by Kai Uwe Broulik
Modified: 2012-06-24 18:57 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9
Sentry Crash Report:


Attachments
Battery icon broken (82.54 KB, image/png)
2012-06-12 17:45 UTC, Kai Uwe Broulik
Details
45% remaining, iconin panel has 2 bars, icon in tooltip has only 1 bar (52.60 KB, image/png)
2012-06-12 19:29 UTC, Anne-Marie Mahfouf
Details
battery applet at 10% charge (67.73 KB, image/png)
2012-06-21 13:03 UTC, Viranch Mehta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2012-06-12 17:45:06 UTC
In the plasmoid’s popup there is another battery icon which is broken at least when the battery is at 10% or lower. See attachment.

Reproducible: Always
Comment 1 Kai Uwe Broulik 2012-06-12 17:45:29 UTC
Created attachment 71771 [details]
Battery icon broken
Comment 2 Anne-Marie Mahfouf 2012-06-12 19:29:52 UTC
Created attachment 71773 [details]
45% remaining, iconin panel has 2 bars, icon in tooltip has only 1 bar
Comment 3 Mark 2012-06-19 23:28:13 UTC
In the first screenshot. I certainly hope the switch element isn't used in the desktop version. That would be the begin of very nasty inconsistency.

Anyway, was the percentage and the bar fine in KDE 4.8.x? If so, please do add the regression keyword.
Comment 4 Kai Uwe Broulik 2012-06-20 01:17:02 UTC
The switch was unfortunately replaced by a checkbox now in Beta 2. A Switch is predestined for two-state things and I hope it will emerge on the desktop as well. The QML checkbox also looks inconsistent with the rest, so ..
Comment 5 Myriam Schweingruber 2012-06-20 09:50:45 UTC
(In reply to comment #3)
...
> Anyway, was the percentage and the bar fine in KDE 4.8.x? If so, please do
> add the regression keyword.

One needs "editbugs" rights to add keywords, please add that yourself.
Comment 6 Mark 2012-06-20 10:49:22 UTC
(In reply to comment #5)
> (In reply to comment #3)
> ...
> > Anyway, was the percentage and the bar fine in KDE 4.8.x? If so, please do
> > add the regression keyword.
> 
> One needs "editbugs" rights to add keywords, please add that yourself.

done.
Comment 7 Viranch Mehta 2012-06-21 12:34:09 UTC
(In reply to comment #2)
> Created attachment 71773 [details]
> 45% remaining, iconin panel has 2 bars, icon in tooltip has only 1 bar

This was in previous version too, both the icons have different number of bars even for full battery (5 bars for in applet icon, and 4 bars in the icon in the popup, so this difference is scaled at all percentages). so _this_ is not a regression.
Comment 8 Viranch Mehta 2012-06-21 12:46:01 UTC
Git commit 75dfd6f83f5d3dd5b4e2226ab6938eccc1f179ac by Viranch Mehta.
Committed on 21/06/2012 at 14:28.
Pushed by viranch into branch 'master'.

Fix the popup battery icon when the battery charge
is below 10%
FIXED-IN:4.9

M  +1    -0    plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml

http://commits.kde.org/kde-workspace/75dfd6f83f5d3dd5b4e2226ab6938eccc1f179ac
Comment 9 Viranch Mehta 2012-06-21 13:03:45 UTC
Created attachment 72015 [details]
battery applet at 10% charge

screenshot after fixing the bug (just for reference)
Comment 10 Christoph Feck 2012-06-24 13:55:49 UTC
This causes a regression. When the battery gets removed, the "Unavailable" element is no longer displayed. The following patch fixes it.

diff --git a/plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml b/plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml
index ea5f82b..cfb50df 100644
--- a/plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml
+++ b/plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml
@@ -42,7 +42,7 @@ Item {
         anchors.fill: parent
         svg: svg
         elementId: hasBattery ? fillElement(percent) : "Unavailable"
-        visible: percent>10
+        visible: percent>10 || !hasBattery
     }
 
     function fillElement(p) {
Comment 11 Viranch Mehta 2012-06-24 18:57:12 UTC
Git commit 7668f435d5ceebf67363764661cdf3e128e9c30b by Viranch Mehta.
Committed on 24/06/2012 at 20:53.
Pushed by viranch into branch 'master'.

Show the "Unavailable" FrameSvg when battery is not
inserted into the computer
(patch submitted by Christoph)

M  +1    -1    plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml

http://commits.kde.org/kde-workspace/7668f435d5ceebf67363764661cdf3e128e9c30b