Option to show percentage charge in the icon
ClosedPublic

Authored by mart on Dec 5 2016, 6:18 PM.

Details

Summary

add an option to show a text label with the percentage value
in the battery icon. text will be shown bottom-right
of the icon with a background for readability, similar to
unread count for IM or email apps.
code was already there but effectively dead code

Test Plan

tried both with and without label

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart updated this revision to Diff 8786.Dec 5 2016, 6:18 PM
mart retitled this revision from to Option to show percentage charge in the icon.
mart updated this object.
mart edited the test plan for this revision. (Show Details)
mart added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptDec 5 2016, 6:18 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart added a comment.Dec 5 2016, 6:19 PM

(on higher dpi screens should look a bit better)

mart updated this revision to Diff 8787.Dec 5 2016, 6:20 PM
  • correct copyright
mart updated this revision to Diff 8788.Dec 5 2016, 6:21 PM
  • correct copyright
broulik added a subscriber: broulik.Dec 5 2016, 8:23 PM

Nifty. That I haven't thought of that kind of placement before. I always wanted some crappy overlay like we had before.

Can you please check again with opacity mask instead of just overlaying a Rectangle. Also, what's up with the Canvas thing?

applets/batterymonitor/package/contents/config/main.xml
12

I think this could even be the default?

applets/batterymonitor/package/contents/ui/CompactRepresentation.qml
71–72

for fonts avoid vertically anchoring it, use verticalAlignment instead to ensure descenders are properly taken into account

71–72

Can you instead try an OpacityMask / ShaderEffect thing like I did in task manager for the badge so we actually cut out a piece of the icon instead of just overlaying an opaque rectangle?

applets/batterymonitor/package/contents/ui/CompactRepresentationCircle.qml
54 ↗(On Diff #8788)

;)

mart added a comment.Dec 5 2016, 9:23 PM

eew, sorry, that canvas thing was from an old experiment i did for a possible alternative graphics, which i forgot to kill ;)

applets/batterymonitor/package/contents/config/main.xml
12

not sure it's pretty enough for default (yet?), in the end may give some problems (like covering the red x that shows up when the battery is removed, that's rare in modern laptops, but still)

applets/batterymonitor/package/contents/ui/CompactRepresentation.qml
71–72

sure

mart updated this revision to Diff 8802.Dec 6 2016, 11:06 AM
  • light shadow on the label

You forgot BadgeOverlay.qml

applets/batterymonitor/package/contents/ui/ConfigGeneral.qml
29

Unused

31–32

Not needed since we have implicitWidth?

38

Unused

mart updated this revision to Diff 8840.Dec 7 2016, 11:47 AM
  • add missing file
broulik accepted this revision.Dec 7 2016, 11:53 AM
broulik added a reviewer: broulik.
broulik added inline comments.
applets/batterymonitor/package/contents/ui/BadgeOverlay.qml
32

just use anchors?

This revision is now accepted and ready to land.Dec 7 2016, 11:53 AM
mart updated this revision to Diff 8843.Dec 7 2016, 11:55 AM
mart edited edge metadata.
  • use anchors
This revision was automatically updated to reflect the committed changes.