Skip to content

kcms/energy: Improve layout of the device selector

Ismael Asensio requested to merge work/iasensio/energy-device-size into master

Port the device selector to an actual ListView instead of Row+Repeater combo, so we can use the implicit height of the delegate, instead of imposing a fixed height, which fails for bigger fonts.

While at it, fix some layout issues within the delegates and simplify the code by using the ListView regular properties to initialize and select the current device.

As an added benefit there is now keyboard navigation

BUG: 499290
BUG: 499350
FIXED-IN: 6.4

BEFORE AFTER
10pt energy-10pt-before energy-2batteries.png
14pt (+ Spanish label) Screenshot_20250206_104821.png Screenshot_20250206_105045.png
Full of devices Screenshot_20250206_105249.png Screenshot_20250206_104504.png

For testing I've been using bluetooth devices as secondary batteries, but I remember it requires some tweaking somewhere in the stack to get their batteries listed by upower.

Also not proposing for cherry-pick as the change is a bit invasive for after Beta2 (couldn't get it to work in less steps)

Edited by Ismael Asensio

Merge request reports

Loading