QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ToolIndicatorPage.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6
7// ToolIndicatorPage
8// The base control for all Toolbar Indicator drop down pages. It supports a normal and expanded view.
9
10RowLayout {
11 id: control
12 spacing: ScreenTools.defaultFontPixelWidth
13
14 property bool showExpand: false // Controls whether the expand widget is shown or not
15 property bool waitForParameters: false // UI won't show until parameters are ready
16 property bool expandedComponentWaitForParameters: false // If true, the expanded component won't show until parameters are ready
17 property Component contentComponent // Item for the normal view portion of the page
18 property Component expandedComponent // Item for the expanded portion of the page
19 property var pageProperties // Allows you to share a QtObject full of properties between pages
20
21 // These properties are bound by the MainRoowWindow loader
22 property bool expanded: false
23 property var drawer
24
25 property var activeVehicle: QGroundControl.multiVehicleManager.vehicle
26 property bool parametersReady: QGroundControl.multiVehicleManager.parameterReadyVehicleAvailable
27
28 property bool _showMainComponent: !waitForParameters || parametersReady
29 property bool _showExpand: showExpand && expandedComponent !== undefined && (!expandedComponentWaitForParameters || parametersReady)
30
31 QGCLabel {
32 text: qsTr("Waiting for parameters...")
33 visible: waitForParameters && !parametersReady
34 }
35
36 Loader {
37 id: contentItemLoader
38 Layout.alignment: Qt.AlignTop
39 sourceComponent: _showMainComponent ? contentComponent : undefined
40
41 property var pageProperties: control.pageProperties
42 }
43
44 Rectangle {
45 id: divider
46 Layout.preferredWidth: visible ? 1 : -1
47 Layout.fillHeight: true
48 color: QGroundControl.globalPalette.groupBorder
49 visible: expanded
50 }
51
52 Loader {
53 id: expandedItemLoader
54 Layout.alignment: Qt.AlignTop
55 Layout.preferredWidth: visible ? -1 : 0
56 visible: expanded
57 sourceComponent: expanded ? expandedComponent : undefined
58
59 property var pageProperties: control.pageProperties
60 }
61}