The value of previousItemInFocusChain is appletContainer when the applet
is on desktop, but we don't want to establish hidden tab focus relation
between appletContainer and the last battery item, so use `Keys.onTabPressed`
instead.
1. Add arrow key navigation support
2. Imrpove a11y description for battery items, so messages like "Your
battery is unhealthy" can be read by a screen reader.
This is a common snippet of code in applets. It prevents applet from
re-expanding again when user clicks on the compact representation when
the applet is already expanded and located on a desktop containment.
Instead of using a ScrollView just for the battery items, convert the
existing ColumnLayout to the header of the ListView. Then everything
works magically :)
Co-Authored-By: Carl Schwan <carl@carlschwan.eu>
Power profile labels are gone and replaced with only two descriptive
icons, and now there's only one of label at the top of the slider,
which aligns with what `BrightnessItem`s do.
Padding of the header is handled now entirely within the header itself.
Kernel developers have said that charge limits are approximate, not
exact[1]. As a result, if for example you have a charge limit of 80%,
your battery might actually stop charging anywhere between 78-82%. But
if we only list the charge limit itself, it looks to users like a KDE
bug when the battery stops charging at any number other than that limit.
To alleviate that, this commit adjusts the text to indicate that the
charge limit is appropximate.
[1] https://bugzilla.kernel.org/show_bug.cgi?id=215531#c3
When we are using a charge threshold, the kernel may stop charging
within a percentage point of the actual threshold and this is
considered correct behavior, so we have to handle that. See
https://bugzilla.kernel.org/show_bug.cgi?id=215531.
Also, Upower may give us a status of "Not charging" rather than
"Fully charged", so we need to account for that as well. See
https://gitlab.freedesktop.org/upower/upower/-/issues/142.
BUG: 435931
No more one/many hints discrimination. They can all live happy together,
under single Repeater, using model directly. When the model will
migrate to a real Qt AbstractModel subclass (e.g. QML ListModel),
delegate's properties code will need to be adjusted again though.
Pass down laptop's lid action inhibition all the way from the top-level
file to reduce dependency on sketchy context properties and make
components more self-contained.
"Fix" as in "repair and make it right". This commit actually makes
header dynamic as it was always supposed to be. Wrongly fixed height
with dummy empty padding at the bottom was the result of incorrectly
applied anchors within Container[1]'s contentChildren.
[1]: PlasmoidHeading is a TabBar which inherits from Container and Control.
Technically it doesn't matter, since they are mutually exclusive anyway.
But for the upcoming refactoring it will be a bit easier to see what's
going on if they'll be close to each other.
Typically we have properties on top, then functions, then signal
handlers, then child items, then the onCompleted: block. The Battery
Monitor didn't conform to that, so this commit makes it do so. There are
no actual code changes; stuff is simply moved around for greater clarity
and style standardization.
f9e39815d ("applets/batterymonitor: Improve for desktop systems") changed the
plasmoid to use a plain icon instead of the CompactRepresentation if there are
no batteries.
While 471cc3745 ("applets/batterymonitor: fix CompactRepresentation") brought
the use of the CompactRepresentation back, the plain icon is still used.
For the case that there are no batteries and brightness controls available,
it fell back to "battery", which has no symbolic variant. Change that to use
the symbolic "video-display-brightness" as well.
BUG: 448520
This reverts commit 354f7da871.
Somehow it prevents inhibitions from being visible in the UI. Since the
reason is not yet understood, let's revert for now to prevent releasing
a regression while we investigate.
CCMAIL: me@ratijas.tk
In the process, the onWheel handler is moved up to the main file so that
it gains write access to the screenBrightness property. This is how
other scrollable applets handle the same situation.