From ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 23 Sep 2026 21:08:35 +0200 Subject: ... --- .../shell/quickshell/WaylandInhibitorWidget.qml | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 accounts/gkleen@skadhi/shell/quickshell/WaylandInhibitorWidget.qml (limited to 'accounts/gkleen@skadhi/shell/quickshell/WaylandInhibitorWidget.qml') diff --git a/accounts/gkleen@skadhi/shell/quickshell/WaylandInhibitorWidget.qml b/accounts/gkleen@skadhi/shell/quickshell/WaylandInhibitorWidget.qml new file mode 100644 index 00000000..0512ff51 --- /dev/null +++ b/accounts/gkleen@skadhi/shell/quickshell/WaylandInhibitorWidget.qml @@ -0,0 +1,56 @@ +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 + cursorShape: Qt.PointingHandCursor + + 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