From 4817afd1707c9a572af755a4751f97a8fa5a80c1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 22 Jun 2026 11:39:13 +0200 Subject: ... --- .../shell/quickshell/LockscreenInhibitorWidget.qml | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml (limited to 'accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml') diff --git a/accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml new file mode 100644 index 00000000..1cbf3f16 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml @@ -0,0 +1,48 @@ +import Quickshell +import QtQuick +import Quickshell.Widgets +import qs.Services + +Item { + id: root + + width: icon.width + 8 + height: parent.height + anchors.verticalCenter: parent.verticalCenter + + WrapperMouseArea { + id: widgetMouseArea + + anchors.fill: parent + + // enabled: InhibitorState.lockscreenInhibited || !InhibitorState.waylandIdleInhibited + hoverEnabled: true + cursorShape: widgetMouseArea.enabled ? Qt.PointingHandCursor : undefined + + onClicked: InhibitorState.lockscreenInhibited = !InhibitorState.lockscreenInhibited + + 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: InhibitorState.lockscreenInhibited || InhibitorState.waylandIdleInhibited ? "lock-off" : "lock" + color: InhibitorState.lockscreenInhibited ? "#f28a21" : "#555" + } + } + } + } +} -- cgit v1.2.3