Split out indicators
This commit is contained in:
@@ -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() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user