Skip to content

Commit 1e1ba93

Browse files
committed
core/window: add manual PanelWindow tester
1 parent 59d29bb commit 1e1ba93

File tree

1 file changed

+151
-0
lines changed

1 file changed

+151
-0
lines changed

src/window/test/manual/panel.qml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
import QtQuick
2+
import QtQuick.Controls
3+
import QtQuick.Layouts
4+
import Quickshell
5+
6+
Scope {
7+
FloatingWindow {
8+
color: contentItem.palette.window
9+
minimumSize.width: layout.implicitWidth
10+
minimumSize.height: layout.implicitHeight
11+
12+
ColumnLayout {
13+
id: layout
14+
15+
RowLayout {
16+
CheckBox {
17+
id: visibleCb
18+
text: "Visible"
19+
checked: true
20+
}
21+
22+
CheckBox {
23+
id: aboveCb
24+
text: "Above Windows"
25+
checked: true
26+
}
27+
}
28+
29+
RowLayout {
30+
ColumnLayout {
31+
CheckBox {
32+
id: leftAnchorCb
33+
text: "Left"
34+
}
35+
36+
SpinBox {
37+
id: leftMarginSb
38+
editable: true
39+
value: 0
40+
to: 1000
41+
}
42+
}
43+
44+
ColumnLayout {
45+
CheckBox {
46+
id: rightAnchorCb
47+
text: "Right"
48+
}
49+
50+
SpinBox {
51+
id: rightMarginSb
52+
editable: true
53+
value: 0
54+
to: 1000
55+
}
56+
}
57+
58+
ColumnLayout {
59+
CheckBox {
60+
id: topAnchorCb
61+
text: "Top"
62+
}
63+
64+
SpinBox {
65+
id: topMarginSb
66+
editable: true
67+
value: 0
68+
to: 1000
69+
}
70+
}
71+
72+
ColumnLayout {
73+
CheckBox {
74+
id: bottomAnchorCb
75+
text: "Bottom"
76+
}
77+
78+
SpinBox {
79+
id: bottomMarginSb
80+
editable: true
81+
value: 0
82+
to: 1000
83+
}
84+
}
85+
}
86+
87+
RowLayout {
88+
ComboBox {
89+
id: exclusiveModeCb
90+
model: [ "Normal", "Ignore", "Auto" ]
91+
currentIndex: w.exclusionMode
92+
}
93+
94+
SpinBox {
95+
id: exclusiveZoneSb
96+
editable: true
97+
value: 100
98+
to: 1000
99+
}
100+
}
101+
102+
RowLayout {
103+
Label { text: "Width" }
104+
105+
SpinBox {
106+
id: widthSb
107+
editable: true
108+
value: 100
109+
to: 1000
110+
}
111+
}
112+
113+
RowLayout {
114+
Label { text: "Height" }
115+
116+
SpinBox {
117+
id: heightSb
118+
editable: true
119+
value: 100
120+
to: 1000
121+
}
122+
}
123+
}
124+
}
125+
126+
PanelWindow {
127+
id: w
128+
visible: visibleCb.checked
129+
aboveWindows: aboveCb.checked
130+
131+
anchors {
132+
left: leftAnchorCb.checked
133+
right: rightAnchorCb.checked
134+
top: topAnchorCb.checked
135+
bottom: bottomAnchorCb.checked
136+
}
137+
138+
margins {
139+
left: leftMarginSb.value
140+
right: rightMarginSb.value
141+
top: topMarginSb.value
142+
bottom: bottomMarginSb.value
143+
}
144+
145+
exclusionMode: exclusiveModeCb.currentIndex
146+
exclusiveZone: exclusiveZoneSb.value
147+
148+
implicitWidth: widthSb.value
149+
implicitHeight: heightSb.value
150+
}
151+
}

0 commit comments

Comments
 (0)