diff --git a/applets/batterymonitor/package/contents/ui/PopupDialog.qml b/applets/batterymonitor/package/contents/ui/PopupDialog.qml index 0d1003331..e8820fd92 100644 --- a/applets/batterymonitor/package/contents/ui/PopupDialog.qml +++ b/applets/batterymonitor/package/contents/ui/PopupDialog.qml @@ -36,6 +36,7 @@ PlasmaComponents3.Page { // Reason: string, // }] property var inhibitions: [] + property bool inhibitsLidAction property string inhibitionReason property string degradationReason @@ -51,6 +52,7 @@ PlasmaComponents3.Page { id: pmSwitch inhibitions: dialog.inhibitions + inhibitsLidAction: dialog.inhibitsLidAction pluggedIn: dialog.pluggedIn onDisabledChanged: powerManagementChanged(disabled) diff --git a/applets/batterymonitor/package/contents/ui/PowerManagementItem.qml b/applets/batterymonitor/package/contents/ui/PowerManagementItem.qml index d080db62b..e88372a54 100644 --- a/applets/batterymonitor/package/contents/ui/PowerManagementItem.qml +++ b/applets/batterymonitor/package/contents/ui/PowerManagementItem.qml @@ -27,6 +27,7 @@ ColumnLayout { // Reason: string, // }] property var inhibitions: [] + property bool inhibitsLidAction // UI to manually inhibit sleep and screen locking PlasmaComponents3.CheckBox { @@ -56,7 +57,7 @@ ColumnLayout { InhibitionHint { Layout.fillWidth: true - visible: pmSource.data["PowerDevil"] && pmSource.data["PowerDevil"]["Is Lid Present"] && !pmSource.data["PowerDevil"]["Triggers Lid Action"] ? true : false + visible: root.inhibitsLidAction iconSource: "computer-laptop" text: i18nc("Minimize the length of this string as much as possible", "Your notebook is configured not to sleep when closing the lid while an external monitor is connected.") } diff --git a/applets/batterymonitor/package/contents/ui/main.qml b/applets/batterymonitor/package/contents/ui/main.qml index 15a6dd41a..2a83ac391 100644 --- a/applets/batterymonitor/package/contents/ui/main.qml +++ b/applets/batterymonitor/package/contents/ui/main.qml @@ -242,6 +242,7 @@ Item { readonly property string actuallyActiveProfile: pmSource.data["Power Profiles"] ? (pmSource.data["Power Profiles"]["Current Profile"] || "") : "" activeProfile: actuallyActiveProfile inhibitions: batterymonitor.inhibitions + inhibitsLidAction: pmSource.data["PowerDevil"] && pmSource.data["PowerDevil"]["Is Lid Present"] && !pmSource.data["PowerDevil"]["Triggers Lid Action"] ? true : false profiles: pmSource.data["Power Profiles"] ? (pmSource.data["Power Profiles"]["Profiles"] || []) : [] inhibitionReason: pmSource.data["Power Profiles"] ? (pmSource.data["Power Profiles"]["Performance Inhibited Reason"] || "") : "" degradationReason: pmSource.data["Power Profiles"] ? (pmSource.data["Power Profiles"]["Performance Degraded Reason"] || "") : ""