-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathScalePanelWindow.qml
More file actions
77 lines (62 loc) · 1.24 KB
/
ScalePanelWindow.qml
File metadata and controls
77 lines (62 loc) · 1.24 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// ScalePanelWindow.qml
import QtQuick
import Quickshell
import Quickshell.Hyprland
PanelWindow {
id: window
property var modelData
screen: modelData
property var scaleItemAlias
property var mainPanelAlias
property bool focusGrab: false
anchors {
top: true
right: true
bottom: true
left: true
}
color: "#00000000"
implicitHeight: mainPanelAlias.height + 50
implicitWidth: mainPanelAlias.width + 50
mask: Region {
x: mainPanelAlias.x
y: mainPanelAlias.y
width: {
if (scaleItemAlias.state == "open") {
mainPanelAlias.width
} else {
0
}
}
height: {
if (scaleItemAlias.state == "open") {
mainPanelAlias.height
} else {
0
}
}
}
signal windowOpened()
signal windowClosed()
function toggleOpen() {
if (scaleItemAlias.state == "open") {
close()
} else {
open()
}
}
function open() {
scaleItemAlias.state = "open"
windowOpened()
}
function close() {
scaleItemAlias.state = ""
windowClosed()
}
HyprlandFocusGrab {
id: focusGrab
active: scaleItemAlias.state == "open" && window.focusGrab ? true : false
onCleared: window.close()
windows: [ window ]
}
}