diff options
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml')
-rw-r--r-- | accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml | 47 |
1 files changed, 47 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..8410dcda --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml | |||
@@ -0,0 +1,47 @@ | |||
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 | cursorShape: Qt.PointingHandCursor | ||
20 | |||
21 | onClicked: InhibitorState.lidSwitchInhibited = !InhibitorState.lidSwitchInhibited | ||
22 | |||
23 | Rectangle { | ||
24 | anchors.fill: parent | ||
25 | color: { | ||
26 | if (widgetMouseArea.containsMouse) { | ||
27 | return "#33808080"; | ||
28 | } | ||
29 | return "transparent"; | ||
30 | } | ||
31 | |||
32 | Item { | ||
33 | anchors.fill: parent | ||
34 | |||
35 | MaterialDesignIcon { | ||
36 | id: icon | ||
37 | |||
38 | implicitSize: 14 | ||
39 | anchors.centerIn: parent | ||
40 | |||
41 | icon: InhibitorState.lidSwitchInhibited ? "laptop-off" : "laptop" | ||
42 | color: InhibitorState.lidSwitchInhibited ? "#f28a21" : "#555" | ||
43 | } | ||
44 | } | ||
45 | } | ||
46 | } | ||
47 | } | ||