summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml')
-rw-r--r--accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml48
1 files changed, 48 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml
new file mode 100644
index 00000000..1cbf3f16
--- /dev/null
+++ b/accounts/gkleen@sif/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}