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 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
21 // These properties are bound by the MainRoowWindow loader
22 property bool expanded: false
25 property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
26 property bool parametersReady: QGroundControl.multiVehicleManager.parameterReadyVehicleAvailable
28 property bool _showMainComponent: !waitForParameters || parametersReady
29 property bool _showExpand: showExpand && expandedComponent !== undefined
30 property bool _expandedParametersReady: !expandedComponentWaitForParameters || parametersReady
31 property string _waitingForParamsText: activeVehicle && activeVehicle.parameterManager.parameterDownloadSkipped ? qsTr("Parameters not available") : qsTr("Waiting for parameters...")
34 text: control._waitingForParamsText
35 visible: waitForParameters && !parametersReady
40 Layout.alignment: Qt.AlignTop
41 sourceComponent: _showMainComponent ? contentComponent : undefined
43 property var pageProperties: control.pageProperties
48 Layout.preferredWidth: visible ? 1 : -1
49 Layout.fillHeight: true
50 color: QGroundControl.globalPalette.groupBorder
55 text: activeVehicle && activeVehicle.parameterManager.parameterDownloadSkipped ? qsTr("Parameters not available") : qsTr("Waiting for parameters...")
56 visible: expanded && !_expandedParametersReady
57 Layout.alignment: Qt.AlignTop
61 id: expandedItemLoader
62 Layout.alignment: Qt.AlignTop
63 Layout.preferredWidth: visible ? -1 : 0
64 visible: expanded && _expandedParametersReady
65 sourceComponent: expanded && _expandedParametersReady ? expandedComponent : undefined
67 property var pageProperties: control.pageProperties