Bug 301753

Summary: Icon in the battery popup broken with 10% battery left
Product: [Plasma] plasma4 Reporter: Kai Uwe Broulik <kde>
Component: widget-batteryAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: annma, cfeck, markg85, viranch.mehta
Priority: NOR Keywords: regression
Version: 4.8.80 (beta1)   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 4.9
Attachments: Battery icon broken
45% remaining, iconin panel has 2 bars, icon in tooltip has only 1 bar
battery applet at 10% charge

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