diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-11 23:17:57 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-11 23:17:57 +0200 |
commit | 564853110a6e1367cc379bd8418d874829302d00 (patch) | |
tree | a6d548f7ae9379810f6d3942b10217364ca54c99 /accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml | |
parent | dd2df931a3be1a6518c1e9fbff438de4274456cd (diff) | |
download | nixos-564853110a6e1367cc379bd8418d874829302d00.tar nixos-564853110a6e1367cc379bd8418d874829302d00.tar.gz nixos-564853110a6e1367cc379bd8418d874829302d00.tar.bz2 nixos-564853110a6e1367cc379bd8418d874829302d00.tar.xz nixos-564853110a6e1367cc379bd8418d874829302d00.zip |
...
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml')
-rw-r--r-- | accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml new file mode 100644 index 00000000..2be0692a --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml | |||
@@ -0,0 +1,46 @@ | |||
1 | import Quickshell | ||
2 | import QtQuick | ||
3 | import Quickshell.Widgets | ||
4 | import qs.Services | ||
5 | |||
6 | Item { | ||
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 | hoverEnabled: true | ||
19 | |||
20 | onClicked: InhibitorState.lidSwitchInhibited = !InhibitorState.lidSwitchInhibited | ||
21 | |||
22 | Rectangle { | ||
23 | anchors.fill: parent | ||
24 | color: { | ||
25 | if (widgetMouseArea.containsMouse) { | ||
26 | return "#33808080"; | ||
27 | } | ||
28 | return "transparent"; | ||
29 | } | ||
30 | |||
31 | Item { | ||
32 | anchors.fill: parent | ||
33 | |||
34 | MaterialDesignIcon { | ||
35 | id: icon | ||
36 | |||
37 | implicitSize: 14 | ||
38 | anchors.centerIn: parent | ||
39 | |||
40 | icon: InhibitorState.lidSwitchInhibited ? "laptop-off" : "laptop" | ||
41 | color: InhibitorState.lidSwitchInhibited ? "#f28a21" : "#555" | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | } | ||
46 | } | ||