battery: Improve the brightness responsiveness
ClosedPublic

Authored by apol on Dec 16 2019, 1:14 AM.

Details

Summary

Use QQC2.Slider, so that we have a moved signal. This way we can only
issue new brightnesses when the user actually interacts with it.
Don't adapt to the system brightness until we have finished interacting
with it.

Test Plan

Manual testing, flickering is very much reduced both when scrolling over the
compact plasmoid as well as the slider.

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.
apol created this revision.Dec 16 2019, 1:14 AM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 16 2019, 1:14 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
apol requested review of this revision.Dec 16 2019, 1:14 AM

PlasmaComponents 3 Slider doesn't react to wheel events, which must be fixed before this can go in.

applets/batterymonitor/package/contents/ui/PopupDialog.qml
48

What about this?

applets/batterymonitor/package/contents/ui/batterymonitor.qml
109

Should we not forward the notion of "moved" here, too?

applets/batterymonitor/package/contents/ui/logic.js
53

Wouldn't that cause subsequent calls to fail if the previous hasn't finished yet? Wouldn't that be annoying if you drag the slider quickly?

apol updated this revision to Diff 71743.Dec 17 2019, 6:52 PM

Use a more meaningful step size for the screen. Having steps of 1 in a 1 to 7000 slider was awkward.

apol marked an inline comment as done.Dec 30 2019, 5:50 PM
apol added inline comments.
applets/batterymonitor/package/contents/ui/logic.js
53

No, it will be called eventually, which is all that matters.

broulik accepted this revision.Dec 30 2019, 5:55 PM

Seems to work well, thanks

This revision is now accepted and ready to land.Dec 30 2019, 5:55 PM
This revision was automatically updated to reflect the committed changes.