From 564853110a6e1367cc379bd8418d874829302d00 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 11 Sep 2025 23:17:57 +0200 Subject: ... --- .../shell/quickshell/LidSwitchInhibitorWidget.qml | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml (limited to 'accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml') diff --git a/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml new file mode 100644 index 00000000..2be0692a --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml @@ -0,0 +1,46 @@ +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 + + hoverEnabled: true + + onClicked: InhibitorState.lidSwitchInhibited = !InhibitorState.lidSwitchInhibited + + 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.lidSwitchInhibited ? "laptop-off" : "laptop" + color: InhibitorState.lidSwitchInhibited ? "#f28a21" : "#555" + } + } + } + } +} -- cgit v1.2.3