blob: 1cbf3f1670ffcac3958fe528fcfc3242fb873679 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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"
}
}
}
}
}
|