-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
362 lines (307 loc) · 10.9 KB
/
main.qml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import Qt.labs.settings 1.1
import Hive 1.0
ApplicationWindow {
id: window
width: 260
height: 515
visible: true
palette {
button: "#48abff"
buttonText: "#f5f6f7"
highlight: "#5c75f4"
highlightedText: "#f5f6f7"
base: "#1d1c21"
text: "#f5f6f7"
window: '#1d1c21'
windowText: "#f5f6f7"
}
component ButtonColor: Button {
width: 20; height: width; text: '\u25cf'
onClicked: {
window.palette.button = palette.button
window.palette.buttonText = palette.buttonText
window.palette.highlight = Qt.darker(palette.button, 1.5)
}
}
component BackColor: Button {
width: 20; height: width; text: '\u25cf'
onClicked: {
window.palette.base = palette.button
window.palette.text = palette.buttonText
window.palette.window = palette.button
window.palette.windowText = palette.buttonText
}
}
FontLoader {
id: carlito
source: "resources/Carlito-Regular.ttf"
}
Settings {
id: settings
fileName: 'config.conf'
property real xscroll: scrollView.xscroll
}
Control {
x: 5; y: window.height - height - 10; z: 3
padding: 5
background: Rectangle { color: palette.windowText; opacity: 0.2; radius: 3 }
contentItem: Row {
spacing: 5
ButtonColor { palette{button: '#48abff';buttonText: '#f5f6f7'}}
ButtonColor { palette{button: '#1d1c21';buttonText: '#f5f6f7'}}
ButtonColor { palette{button: '#edc9aa';buttonText: '#f5f6f7'}}
ButtonColor { palette{button: '#ffd166';buttonText: '#1d1c21'}}
ButtonColor { palette{button: '#06d6a0';buttonText: '#1d1c21'}}
ButtonColor { palette{button: '#d5b9ff';buttonText: '#1d1c21'}}
Item { width: 15; height: parent.height }
BackColor { palette {button: '#f5f6f7'; buttonText: '#343536'}}
BackColor { palette {button: '#1d1c21'; buttonText: '#f5f6f7'}}
}
}
ScrollView {
id: scrollView
property real xscroll: ScrollBar.horizontal.position
Component.onCompleted: ScrollBar.horizontal.position = settings.xscroll
anchors.fill: parent
contentWidth: 750
contentHeight: height
Grid {
flow: Grid.LeftToRight
rows: flow == Grid.LeftToRight ? 1 : -1
columns: flow == Grid.LeftToRight ? -1 : 1
padding: 25
spacing: 25
Column {
width: 200
spacing: 10
Frame {
Grid {
rows: -1
columns: 3
spacing: 10
Button {
width: 55
height: width
text: "Color\npicker"
font.family: carlito.name
onClicked: colorPickerW.visible = true
}
Button {
width: 55
height: width
text: "HL\nBtn"
highlighted: true
font { family: carlito.name; weight: Font.Medium; }
}
Button {
width: 55
height: width
text: "Check\nBtn"
checkable: true
font.family: carlito.name
}
Button {
width: 55
height: width
text: "Flat Btn"
flat: true
font.family: carlito.name
}
Button {
width: 40
height: width
text: "Disabled\nBtn"
enabled: false
font.family: carlito.name
}
Button {
width: 40
height: width
highlighted: true
text: "w-40"
font.family: carlito.name
}
HexagonButton {
text: "hexagon"
font.family: carlito.name
}
HexagonButton {
text: "Check\nhexagon"
checkable: true
font.family: carlito.name
}
}
}
Button {
width: parent.width
height: 45
text: "Wide Checkable Button"
checkable: true
font.family: carlito.name
}
Row {
CheckBox {
text: "Check\nbox"
tristate: true
font.family: carlito.name
}
Switch {
text: "Switch"
font.family: carlito.name
}
}
Row {
RadioButton {
text: "Radio 1"
font.family: carlito.name
checked: true
}
RadioButton {
text: "Radio 2"
font.family: carlito.name
}
}
Row {
spacing: 5
Text {
height: 85
text: "Busy Indicator \u2192"
color: window.palette.windowText
verticalAlignment: Text.AlignVCenter
font { family: carlito.name }
}
Rectangle {
width: 85; height: 85
color: 'transparent'
radius: 6
border.width: 1
border.color: palette.windowText
BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
width: 25
height: 25
running: false
}
MouseArea {
anchors.fill: parent
onClicked: busyIndicator.running ^= true
}
}
}
}
Rectangle {
width: 1
height: window.height - 45
color: '#000'
opacity: 0.1
}
Column {
spacing: 7
width: 200
ProgressBar {
width: 180;
value: slider1.value
}
Slider {
id: slider1
width: 180;
value: 0.3
}
RangeSlider {
width: 180;
}
SpinBox {
font.family: carlito.name
to: 10
}
Column {
spacing: 10
TextArea {
width: 180
text: 'Simple example of \nTextArea.'
font.family: carlito.name
}
TextField {
width: 180
text: 'Example text field.'
font.family: carlito.name
}
}
}
Rectangle {
width: 1
height: window.height - 45
color: '#000'
opacity: 0.1
}
Column {
spacing: 5
width: 200
Text {
width: parent.width
text: "Dial"
color: window.palette.windowText
horizontalAlignment: Text.AlignHCenter
font.family: carlito.name
}
Dial {
x: (parent.width - width)/2
width: 100
height: 100
}
Text {
topPadding: 10
width: parent.width
horizontalAlignment: Text.AlignHCenter
text: "Tumbler"
color: window.palette.windowText
font.family: carlito.name
}
Tumbler {
x: (parent.width - width)/2
model: 40
height: 75
visibleItemCount: 3
}
Text {
topPadding: 10
width: parent.width
horizontalAlignment: Text.AlignHCenter
text: "ComboBox"
color: window.palette.windowText
font.family: carlito.name
}
ComboBox {
id: comboBox
model: 2
editable: true
}
Button {
checkable: true
onPressed: comboBox.model = checked ? 2 : 15
text: comboBox.popup.y
}
}
}
}
Window {
id: colorPickerW
ColorPicker {
id: colorPicker;
onSelectedColorChanged: {
window.palette.base = selectedColor
window.palette.button = selectedColor
window.palette.highlight = Qt.darker(selectedColor, 1.5)
window.palette.buttonText = selectedColor.hslLightness < 0.7 ? '#fff' : '#333'
}
}
title: ''
flags: Qt.Tool
minimumWidth: colorPicker.width
minimumHeight: 200
}
}