Tweak idle inhibitor
This commit is contained in:
@@ -12,7 +12,7 @@ Item {
|
|||||||
|
|
||||||
property bool active: false
|
property bool active: false
|
||||||
|
|
||||||
readonly property string icon: active ? "" : ""
|
readonly property string icon: active ? "" : ""
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
if (!statusProc.running) statusProc.running = true
|
if (!statusProc.running) statusProc.running = true
|
||||||
@@ -55,16 +55,17 @@ Item {
|
|||||||
onTriggered: root.refresh()
|
onTriggered: root.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitWidth: button.implicitWidth
|
visible: active
|
||||||
implicitHeight: button.implicitHeight
|
implicitWidth: visible ? button.implicitWidth : 0
|
||||||
|
implicitHeight: visible ? button.implicitHeight : 0
|
||||||
|
|
||||||
WidgetButton {
|
WidgetButton {
|
||||||
id: button
|
id: button
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
bar: root.bar
|
bar: root.bar
|
||||||
text: root.icon
|
text: root.icon
|
||||||
active: root.active
|
active: false
|
||||||
tooltipText: root.active ? "Staying awake — click to allow idle" : "Can idle — click to stay awake"
|
tooltipText: root.active ? "No sleep, lock, or screensaver" : ""
|
||||||
onPressed: function() { root.toggle() }
|
onPressed: function() { root.toggle() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user