QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ParameterDownloadProgress.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3
4import QGroundControl
5import QGroundControl.Controls
6
7/// Provides UI for parameter download progress. This is overlayed on top of the FlyViewToolBar.
8
9Item {
10 id: control
11
12 property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
13
14 // Small parameter download progress bar
15 Rectangle {
16 anchors.bottom: parent.bottom
17 height: control.height * 0.05
18 width: _activeVehicle ? _activeVehicle.loadProgress * parent.width : 0
19 color: QGroundControl.globalPalette.colorGreen
20 visible: !largeProgressBar.visible
21 }
22
23 // Large parameter download progress bar
24 Rectangle {
25 id: largeProgressBar
26 anchors.bottom: parent.bottom
27 anchors.left: parent.left
28 anchors.right: parent.right
29 height: parent.height
30 color: QGroundControl.globalPalette.window
31 visible: _showLargeProgress
32
33 property bool _initialDownloadComplete: _activeVehicle ? _activeVehicle.initialConnectComplete : true
34 property bool _userHide: false
35 property bool _showLargeProgress: !_initialDownloadComplete && !_userHide && QGroundControl.globalPalette.globalTheme === QGCPalette.Light
36
37 Connections {
38 target: QGroundControl.multiVehicleManager
39 function onActiveVehicleChanged(activeVehicle) { largeProgressBar._userHide = false }
40 }
41
42 Rectangle {
43 anchors.top: parent.top
44 anchors.bottom: parent.bottom
45 width: _activeVehicle ? _activeVehicle.loadProgress * parent.width : 0
46 color: QGroundControl.globalPalette.colorGreen
47 }
48
49 QGCLabel {
50 anchors.centerIn: parent
51 text: qsTr("Downloading")
52 font.pointSize: ScreenTools.largeFontPointSize
53 }
54
55 QGCLabel {
56 anchors.margins: _margin
57 anchors.right: parent.right
58 anchors.bottom: parent.bottom
59 text: qsTr("Click anywhere to hide")
60
61 property real _margin: ScreenTools.defaultFontPixelWidth / 2
62 }
63
64 MouseArea {
65 anchors.fill: parent
66 onClicked: parent._userHide = true
67 }
68 }
69}