Added battery health and made it configurable

This commit is contained in:
EinBowser
2025-11-01 20:50:39 +01:00
parent daf7d2c9dc
commit b267b74e8b
4 changed files with 58 additions and 0 deletions
@@ -63,6 +63,29 @@ StyledPopup {
text: Battery.isCharging ? Translation.tr("Time to full:") : Translation.tr("Time to empty:")
color: Appearance.colors.colOnSurfaceVariant
}
RowLayout {
spacing: 5
visible: Config.options.battery.showHealth
Layout.fillWidth: true
MaterialSymbol {
text: "healing"
color: Appearance.colors.colOnSurfaceVariant
iconSize: Appearance.font.pixelSize.large
}
StyledText {
text: Translation.tr("Health:")
color: Appearance.colors.colOnSurfaceVariant
}
StyledText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
color: Appearance.colors.colOnSurfaceVariant
text: `${(Battery.health).toFixed(1)}%`
}
}
StyledText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
@@ -257,6 +257,7 @@ Singleton {
property int full: 101
property bool automaticSuspend: true
property int suspend: 3
property bool showHealth: true
}
property JsonObject conflictKiller: JsonObject {