-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathExample_2.qml
More file actions
287 lines (244 loc) · 7.03 KB
/
Example_2.qml
File metadata and controls
287 lines (244 loc) · 7.03 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
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
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.11
import QtQuick.Window 2.11
import QtQuick.Layouts 1.11
import org.deepin.dtk 1.0
Item {
property string iconStr: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAABFCAYAAAAGscunAAAAAXNSR0IArs4c6QAAATNJREFUeF7t3DEOgkAYBeG3J2NvxnIy2JNhKEwUDYyWMJZmLPh8tH+Jn1OBcloYRCQwApH+Rlozgt9eMymZ9g/2uaQ145Ch1dRrIhw81ZIlPX1KSXvNviKNGVt7724BNmVKSxPp6N8WCbwLIokEBEDikkQCAiBxSSIBAZC4JJGAAEhckkhAACQuSSQgABKXJBIQAIlLEgkIgMQliQQEQOKSRAICIHFJIgEBkLgkkYAASFySSEAAJC5JJCAAEpckEhAAiUsSCQiAxCWJBARA4pJEAgIgcUkiAQGQuCSRgABIXJJIQAAkLkkkIAASlyQSEACJSxIJCIDEJYkEBEDikkQCAiBxSSIBAZD8tKSaessLEz09c2ZwPGETX294XuK5tN0Jju1rr96A11AkkYAASFwSQHoAZNuhVXVGph0AAAAASUVORK5CYII="
RowLayout {
id:row_layout_1
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
QtIcon {
name: iconStr
sourceSize: Qt.size(50, 50)
}
DciIcon {
name: iconStr
sourceSize: Qt.size(50, 50)
}
IconLabel {
icon.name: iconStr
icon.width: 50
icon.height: 50
}
QtIcon {
name: "search_indicator"
color: "red"
MouseArea {
anchors.fill: parent
onClicked: {
if (Qt.colorEqual(parent.color, "red")) {
parent.color = "blue"
} else {
parent.color = "red"
}
}
}
}
BusyIndicator {
running: true
}
BusyIndicator {
running: true
}
RoundButton {
id:roundbutton
width: 28
height: 28
}
Dial {}
Rectangle {
id: frame
clip: true
width: 160
height: 160
border.color: "black"
Text {
id: content
text: "HELLO WORLD"
font.pixelSize: 160
x: -hbar.position * width
y: -vbar.position * height
}
ScrollBar {
id: vbar
hoverEnabled: true
active: hovered || pressed
orientation: Qt.Vertical
size: frame.height / content.height
anchors.top: parent.top
anchors.right: parent.right
anchors.bottom: parent.bottom
ToolTip.visible: hovered
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.text: "This is a ScrollBar!!!"
}
ScrollBar {
id: hbar
hoverEnabled: true
active: hovered || pressed
orientation: Qt.Horizontal
size: frame.width / content.width
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
}
}
StackView {
id: stackview_1
width: 150
height: 150
Component {
id: page
Rectangle {
property real hue: Math.random()
color: Qt.hsla(hue, 0.5, 0.8, 0.6)
border.color: Qt.hsla(hue, 0.5, 0.5, 0.9)
StackView.visible: true
}
}
initialItem: page
MouseArea {
id:area
anchors.fill: parent
onClicked: {
stackview_1.push(page)
}
}
}
}
RectangularShadow {
anchors.fill: shadowSource
glowRadius: 20
spread: 0
color: "black"
cornerRadius: shadowSource.radius
}
Rectangle {
id: shadowSource
width: 300
height: 150
anchors {
left: parent.left
leftMargin: 50
bottom: parent.bottom
bottomMargin: 200
}
radius: 30
color: "red"
}
// test like DropShadow
BoxShadow {
anchors.fill: boxShadowSource
shadowBlur : 20
shadowColor : Qt.rgba(0, 0, 0, 0.9)
shadowOffsetX : 0
shadowOffsetY : 0
cornerRadius: boxShadowSource.radius
hollow: true
}
Rectangle {
id: boxShadowSource
width: 200
height: 200
anchors {
left: shadowSource.right
leftMargin: 50
bottom: shadowSource.bottom
}
color: "red"
radius: 20
}
// test like InnerShadow
BoxInsetShadow {
anchors.fill: boxShadowSource
shadowBlur : 20
shadowColor : Qt.rgba(0, 0, 0, 0.6)
shadowOffsetX : 0
shadowOffsetY : 0
cornerRadius: boxShadowSource.radius
}
ListView {
spacing: 10
anchors {
left: boxShadowSource.right
leftMargin: 50
verticalCenter: boxShadowSource.verticalCenter
}
width: 200
height: 280
model: ListModel {
ListElement {
cornor: 1
}
ListElement {
cornor: 2
}
ListElement {
cornor: 4
}
ListElement {
cornor: 8
}
ListElement {
cornor: 3
}
ListElement {
cornor: 5
}
ListElement {
cornor: 10
}
ListElement {
cornor: 12
}
}
delegate: RoundRectangle {
width: 200
height: 60
color: "blue"
radius: 20
antialiasing: true
corners: cornor
}
}
Rectangle {
id:swipe_view
width: 300
height: 150
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
SwipeView {
id: view
currentIndex: 1
anchors.fill: parent
Rectangle {
color: "red"
width: swipe_view.width
height: swipe_view.height
}
Rectangle {
color: "green"
width: swipe_view.width
height: swipe_view.height
}
Rectangle {
color: "blue"
width: swipe_view.width
height: swipe_view.height
}
}
PageIndicator {
id: indicator
count: view.count
currentIndex: view.currentIndex
anchors.bottom: view.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
}
}