QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
Viewer3DProgressBar.qml
Go to the documentation of this file.
1import QGroundControl
2import QGroundControl.Controls
3
4Rectangle {
5 id: progressBody
6
7 property string progressText: qsTr("Progress")
8 property real progressValue: 100.0
9
10 color: qgcPal.windowShadeDark
11 height: _progressCol.height + 2 * ScreenTools.defaultFontPixelWidth
12 opacity: (progressValue < 100) ? (1.0) : (0.0)
13 radius: ScreenTools.defaultFontPixelWidth * 2
14 visible: opacity > 0
15 width: ScreenTools.screenWidth * 0.2
16
17 Behavior on opacity {
18 NumberAnimation {
19 duration: 300
20 }
21 }
22
23 QGCPalette {
24 id: qgcPal
25
26 colorGroupEnabled: true
27 }
28
29 Column {
30 id: _progressCol
31
32 anchors {
33 left: parent.left
34 right: parent.right
35 verticalCenter: parent.verticalCenter
36 }
37
38 ProgressBar {
39 id: _progressBar
40
41 from: 0
42 to: 100
43 value: progressBody.progressValue
44
45 anchors {
46 left: parent.left
47 margins: ScreenTools.defaultFontPixelWidth
48 right: parent.right
49 }
50 }
51
52 QGCLabel {
53 anchors.horizontalCenter: parent.horizontalCenter
54 color: qgcPal.text
55 font.bold: true
56 font.pointSize: ScreenTools.mediumFontPointSize
57 horizontalAlignment: Text.AlignHCenter
58 text: progressText + Number(Math.floor(progressBody.progressValue)) + " %"
59 }
60 }
61}