Commit 27e3cfca authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Battery Monitor] Fix threshold indicator

I apparently forgot to add some other changes...
Also show it only when threshold is > 0 %

BUG: 426743
FIXED-IN: 5.20.0
parent 378309e6
......@@ -41,6 +41,7 @@ PlasmaComponents3.Page {
PowerManagementItem {
id: pmSwitch
width: parent.width
pluggedIn: dialog.pluggedIn
onEnabledChanged: powermanagementChanged(enabled)
KeyNavigation.tab: batteryList
KeyNavigation.backtab: keyboardBrightnessSlider
......
......@@ -25,7 +25,9 @@ import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.kquickcontrolsaddons 2.0
ColumnLayout {
id: powerManagementHeadingColumn
property alias enabled: pmCheckBox.checked
property bool pluggedIn
spacing: 0
......@@ -69,7 +71,7 @@ ColumnLayout {
InhibitionHint {
Layout.fillWidth: true
readonly property var chargeStopThreshold: pmSource.data["Battery"] ? pmSource.data["Battery"]["Charge Stop Threshold"] : undefined
visible: powerManagementHeadingColumn.pluggedIn && typeof chargeStopThreshold === "number" && chargeStopThreshold < 100
visible: powerManagementHeadingColumn.pluggedIn && typeof chargeStopThreshold === "number" && chargeStopThreshold > 0 && chargeStopThreshold < 100
iconSource: "kt-speed-limits" // FIXME good icon
text: i18n("Your battery is configured to only charge up to %1%.", chargeStopThreshold || 0)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment