-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
58 lines (49 loc) · 1.28 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
import QtQuick 2.5
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import org.example 1.0
Item {
Button {
id: button
text: qsTr("Install latest Chromium")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
onClicked: appHandler.downloadLatest()
}
ProgressBar {
id: progressBar
visible: true
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: button.bottom
anchors.margins: 10
minimumValue: 0
maximumValue: 1
value: 0
style: ProgressBarStyle {
background: Rectangle {
radius: 2
color: "lightgray"
border.color: "black"
border.width: 2
implicitWidth: button.width-7
implicitHeight: 10
}
progress: Rectangle {
color: "#00CC00" // green
border.color: "black"
}
}
}
Connections {
target: appHandler
onUpdateProgress: {
progressBar.value = progress
}
onEnableDownloadButton: {
button.enabled = enable
}
}
AppHandler {
id: appHandler
}
}