-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathLoadingOverlay.qml
More file actions
46 lines (38 loc) · 921 Bytes
/
LoadingOverlay.qml
File metadata and controls
46 lines (38 loc) · 921 Bytes
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
import QtQuick
import QtQuick.Controls
Popup {
id: root
property string text: "" // 加载文本
property color textColor: "#04B5C8"
anchors.centerIn: Overlay.overlay
modal: true
focus: true
closePolicy: Popup.NoAutoClose
background: Rectangle {
color: "transparent"
}
contentItem: Column {
spacing: 10
anchors.centerIn: parent
BusyIndicator {
running: root.visible
anchors.horizontalCenter: parent.horizontalCenter
}
Label {
text: root.text
color: root.textColor
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter
visible: text !== ""
}
}
function show(message) {
if (message !== undefined) {
text = message;
}
open();
}
function hide() {
close();
}
}