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.vehicle
26 property bool parametersReady: QGroundControl.multiVehicleManager.parameterReadyVehicleAvailable
28 property bool _showMainComponent: !waitForParameters || parametersReady
29 property bool _showExpand: showExpand && expandedComponent !== undefined && (!expandedComponentWaitForParameters || parametersReady)
32 text: qsTr("Waiting for parameters...")
33 visible: waitForParameters && !parametersReady
38 Layout.alignment: Qt.AlignTop
39 sourceComponent: _showMainComponent ? contentComponent : undefined
41 property var pageProperties: control.pageProperties
46 Layout.preferredWidth: visible ? 1 : -1
47 Layout.fillHeight: true
48 color: QGroundControl.globalPalette.groupBorder
53 id: expandedItemLoader
54 Layout.alignment: Qt.AlignTop
55 Layout.preferredWidth: visible ? -1 : 0
57 sourceComponent: expanded ? expandedComponent : undefined
59 property var pageProperties: control.pageProperties