Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/batterymonitor.qml
Show All 34 Lines | 30 | Item { | |||
---|---|---|---|---|---|
35 | LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft | 35 | LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft | ||
36 | LayoutMirroring.childrenInherit: true | 36 | LayoutMirroring.childrenInherit: true | ||
37 | 37 | | |||
38 | Plasmoid.status: { | 38 | Plasmoid.status: { | ||
39 | if (powermanagementDisabled) { | 39 | if (powermanagementDisabled) { | ||
40 | return PlasmaCore.Types.ActiveStatus | 40 | return PlasmaCore.Types.ActiveStatus | ||
41 | } | 41 | } | ||
42 | 42 | | |||
43 | if (pmSource.data.Battery["Has Cumulative"]) { | 43 | if (pmSource.data.Battery["Has Cumulative"] | ||
44 | if (pmSource.data.Battery.State !== "Charging" && pmSource.data.Battery.Percent <= 5) { | 44 | && pmSource.data["Battery"]["State"] !== "FullyCharged") { | ||
45 | return PlasmaCore.Types.NeedsAttentionStatus | | |||
46 | } else if (pmSource.data["Battery"]["State"] !== "FullyCharged") { | | |||
47 | return PlasmaCore.Types.ActiveStatus | 45 | return PlasmaCore.Types.ActiveStatus | ||
48 | } | 46 | } | ||
49 | } | | |||
50 | 47 | | |||
51 | return PlasmaCore.Types.PassiveStatus | 48 | return PlasmaCore.Types.PassiveStatus | ||
52 | } | 49 | } | ||
53 | 50 | | |||
54 | Plasmoid.toolTipMainText: { | 51 | Plasmoid.toolTipMainText: { | ||
55 | if (batteries.count === 0) { | 52 | if (batteries.count === 0) { | ||
56 | return i18n("No Batteries Available"); | 53 | return i18n("No Batteries Available"); | ||
57 | } else if (!pmSource.data["Battery"]["Has Cumulative"]) { | 54 | } else if (!pmSource.data["Battery"]["Has Cumulative"]) { | ||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |