diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-12 22:01:51 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-12 22:01:51 +0200 |
| commit | 666464567055a2e4ba9f6bb310e901cdc27977f7 (patch) | |
| tree | 45e626dc591803925880230a3e06d568e6a5fa48 /accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.qml | |
| parent | 1ff0e9ecbef79e1b3592cd4a68ce3e90c8536bdb (diff) | |
| download | nixos-666464567055a2e4ba9f6bb310e901cdc27977f7.tar nixos-666464567055a2e4ba9f6bb310e901cdc27977f7.tar.gz nixos-666464567055a2e4ba9f6bb310e901cdc27977f7.tar.bz2 nixos-666464567055a2e4ba9f6bb310e901cdc27977f7.tar.xz nixos-666464567055a2e4ba9f6bb310e901cdc27977f7.zip | |
...
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.qml')
| -rw-r--r-- | accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.qml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.qml new file mode 100644 index 00000000..3dadbc69 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.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: NotificationManager.displayInhibited = !NotificationManager.displayInhibited | ||
| 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: NotificationManager.displayInhibited ? "message-off" : "message" | ||
| 42 | color: NotificationManager.displayInhibited ? "white" : "#555" | ||
| 43 | } | ||
| 44 | } | ||
| 45 | } | ||
| 46 | } | ||
| 47 | } | ||
