From 93daaf4c504ee2da91b5bbfc9502d0244105bd18 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Sat, 26 Mar 2016 15:04:40 +0100 Subject: [PATCH] [Battery Monitor] Add a "plugged in but not charging" state for the tooltip The tooltip would only take into account the AC adapter state and say the battery is being charged although it isn't. This adds a "Plugged in" state when the AC is plugged in but the battery is not charging. BUG: 355922 FIXED-IN: 5.7.0 --- .../batterymonitor/package/contents/ui/batterymonitor.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/applets/batterymonitor/package/contents/ui/batterymonitor.qml b/applets/batterymonitor/package/contents/ui/batterymonitor.qml index b6e61cdac..4ded6f566 100755 --- a/applets/batterymonitor/package/contents/ui/batterymonitor.qml +++ b/applets/batterymonitor/package/contents/ui/batterymonitor.qml @@ -57,7 +57,12 @@ Item { } else if (pmSource.data["Battery"]["State"] === "FullyCharged") { return i18n("Fully Charged"); } else if (pmSource.data["AC Adapter"] && pmSource.data["AC Adapter"]["Plugged in"]) { - return i18n("%1%. Charging", pmSource.data["Battery"]["Percent"]) + var percent = pmSource.data.Battery.Percent + if (pmSource.data.Battery.State === "Charging") { + return i18n("%1%. Charging", percent) + } else { + return i18nc("AC is plugged in but battery full/not charging", "%1%. Plugged in", percent) + } } else { if (remainingTime > 0) { return i18nc("%1 is remaining time, %2 is percentage", "%1 Remaining (%2%)",