5import QGroundControl.Controls
8// The base control for all Toolbar Indicator drop down pages. It supports a normal and expanded view.
12 spacing: ScreenTools.defaultFontPixelWidth
14 property bool showExpand: false // Controls whether the expand widget is shown or not
15 property bool fillWindow: false // Drawer fills the window below the toolbar
16 property bool waitForParameters: false // UI won't show until parameters are ready
17 property bool expandedComponentWaitForParameters: false // If true, the expanded component won't show until parameters are ready
18 property Component contentComponent // Item for the normal view portion of the page
19 property Component expandedComponent // Item for the expanded portion of the page
20 property var pageProperties // Allows you to share a QtObject full of properties between pages
22 // These properties are bound by the MainRoowWindow loader
23 property bool expanded: false
26 property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
27 property bool parametersReady: QGroundControl.multiVehicleManager.parameterReadyVehicleAvailable
29 property bool _showMainComponent: !waitForParameters || parametersReady
30 property bool _showExpand: showExpand && expandedComponent !== undefined
31 property bool _expandedParametersReady: !expandedComponentWaitForParameters || parametersReady
32 property string _waitingForParamsText: activeVehicle && activeVehicle.parameterManager.parameterDownloadSkipped ? qsTr("Parameters not available") : qsTr("Waiting for parameters...")
35 text: control._waitingForParamsText
36 visible: waitForParameters && !parametersReady
41 Layout.alignment: Qt.AlignTop
42 Layout.fillWidth: fillWindow
43 sourceComponent: _showMainComponent ? contentComponent : undefined
45 property var pageProperties: control.pageProperties
50 Layout.preferredWidth: visible ? 1 : -1
51 Layout.fillHeight: true
52 color: QGroundControl.globalPalette.groupBorder
57 text: activeVehicle && activeVehicle.parameterManager.parameterDownloadSkipped ? qsTr("Parameters not available") : qsTr("Waiting for parameters...")
58 visible: expanded && !_expandedParametersReady
59 Layout.alignment: Qt.AlignTop
63 id: expandedItemLoader
64 objectName: "indicatorExpandedLoader"
65 Layout.alignment: Qt.AlignTop
66 Layout.preferredWidth: visible ? -1 : 0
67 visible: expanded && _expandedParametersReady
68 sourceComponent: expanded && _expandedParametersReady ? expandedComponent : undefined
70 property var pageProperties: control.pageProperties