summaryrefslogtreecommitdiff
path: root/accounts/gkleen@skadhi/shell/quickshell/LockscreenInhibitorWidget.qml
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2026-09-23 21:08:35 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2026-09-23 21:08:35 +0200
commitae9a80c1f012686c1f65fce7ce76fdd1b77b0b71 (patch)
tree141f738276cf84c6b7e5633c2bd5f2b44e9b0b75 /accounts/gkleen@skadhi/shell/quickshell/LockscreenInhibitorWidget.qml
parent6a763272038e637a8a03dd9059d43a1ff44921dd (diff)
downloadnixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar
nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar.gz
nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar.bz2
nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar.xz
nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.zip
...
Diffstat (limited to 'accounts/gkleen@skadhi/shell/quickshell/LockscreenInhibitorWidget.qml')
-rw-r--r--accounts/gkleen@skadhi/shell/quickshell/LockscreenInhibitorWidget.qml48
1 files changed, 48 insertions, 0 deletions
diff --git a/accounts/gkleen@skadhi/shell/quickshell/LockscreenInhibitorWidget.qml b/accounts/gkleen@skadhi/shell/quickshell/LockscreenInhibitorWidget.qml
new file mode 100644
index 00000000..1cbf3f16
--- /dev/null
+++ b/accounts/gkleen@skadhi/shell/quickshell/LockscreenInhibitorWidget.qml
@@ -0,0 +1,48 @@
1import Quickshell
2import QtQuick
3import Quickshell.Widgets
4import qs.Services
5
6Item {
7 id: root
8
9 width: icon.width + 8
10 height: parent.height
11 anchors.verticalCenter: parent.verticalCenter
12
13 WrapperMouseArea {
14 id: widgetMouseArea
15
16 anchors.fill: parent
17
18 // enabled: InhibitorState.lockscreenInhibited || !InhibitorState.waylandIdleInhibited
19 hoverEnabled: true
20 cursorShape: widgetMouseArea.enabled ? Qt.PointingHandCursor : undefined
21
22 onClicked: InhibitorState.lockscreenInhibited = !InhibitorState.lockscreenInhibited
23
24 Rectangle {
25 anchors.fill: parent
26 color: {
27 if (widgetMouseArea.containsMouse) {
28 return "#33808080";
29 }
30 return "transparent";
31 }
32
33 Item {
34 anchors.fill: parent
35
36 MaterialDesignIcon {
37 id: icon
38
39 implicitSize: 14
40 anchors.centerIn: parent
41
42 icon: InhibitorState.lockscreenInhibited || InhibitorState.waylandIdleInhibited ? "lock-off" : "lock"
43 color: InhibitorState.lockscreenInhibited ? "#f28a21" : "#555"
44 }
45 }
46 }
47 }
48}