Split out indicators

This commit is contained in:
David Heinemeier Hansson
2026-05-20 13:05:56 +02:00
parent 8476fa7d82
commit 3b9700682c
12 changed files with 527 additions and 162 deletions
+6 -19
View File
@@ -3,15 +3,10 @@ import Quickshell
import Quickshell.Io
import qs.Ui
BarWidget {
BarIndicator {
id: root
moduleName: "idleInhibitor"
property bool active: false
readonly property string icon: active ? "󰅶" : ""
function refresh() {
if (!statusProc.running) statusProc.running = true
}
@@ -59,17 +54,9 @@ BarWidget {
onTriggered: root.refresh()
}
visible: active
implicitWidth: visible ? button.implicitWidth : 0
implicitHeight: visible ? button.implicitHeight : 0
WidgetButton {
id: button
anchors.fill: parent
bar: root.bar
text: root.icon
active: false
tooltipText: root.active ? "No lock or screensaver" : ""
onPressed: function() { root.toggle() }
}
activeText: "󰅶"
inactiveText: "󰅶"
activeTooltipText: "No lock or screensaver"
inactiveTooltipText: "Idle enabled"
onPressed: function() { root.toggle() }
}