From 564853110a6e1367cc379bd8418d874829302d00 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 11 Sep 2025 23:17:57 +0200 Subject: ... --- .../shell/quickshell/WaylandInhibitorWidget.qml | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 accounts/gkleen@sif/shell/quickshell/WaylandInhibitorWidget.qml (limited to 'accounts/gkleen@sif/shell/quickshell/WaylandInhibitorWidget.qml') diff --git a/accounts/gkleen@sif/shell/quickshell/WaylandInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/WaylandInhibitorWidget.qml new file mode 100644 index 00000000..0633f350 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/WaylandInhibitorWidget.qml @@ -0,0 +1,55 @@ +import Quickshell +import QtQuick +import Quickshell.Widgets +import Quickshell.Wayland +import qs.Services + +Item { + id: root + + required property var window + + width: icon.width + 8 + height: parent.height + anchors.verticalCenter: parent.verticalCenter + + IdleInhibitor { + id: inhibitor + enabled: InhibitorState.waylandIdleInhibited + window: root.window + } + + WrapperMouseArea { + id: widgetMouseArea + + anchors.fill: parent + + hoverEnabled: true + + onClicked: InhibitorState.waylandIdleInhibited = !InhibitorState.waylandIdleInhibited + + Rectangle { + anchors.fill: parent + color: { + if (widgetMouseArea.containsMouse) { + return "#33808080"; + } + return "transparent"; + } + + Item { + anchors.fill: parent + + MaterialDesignIcon { + id: icon + + implicitSize: 14 + anchors.centerIn: parent + + icon: inhibitor.enabled ? "eye" : "eye-off" + color: inhibitor.enabled ? "white" : "#555" + } + } + } + } +} -- cgit v1.2.3