7import QGroundControl.Controls
8import QGroundControl.FlyView
11 required property var guidedValueSlider
15 height: ScreenTools.toolbarHeight
17 property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
18 property bool _communicationLost: _activeVehicle ? _activeVehicle.vehicleLinkManager.communicationLost : false
19 property color _mainStatusBGColor: qgcPal.brandingPurple
20 property real _leftRightMargin: ScreenTools.defaultFontPixelWidth * 0.75
21 property var _guidedController: globals.guidedControllerFlyView
23 function dropMainStatusIndicatorTool() {
24 mainStatusIndicator.dropMainStatusIndicator();
27 QGCPalette { id: qgcPal }
31 contentWidth: toolBarLayout.width
32 flickableDirection: Flickable.HorizontalFlick
41 width: leftPanelLayout.implicitWidth
44 // Gradient background behind Q button and main status indicator
46 id: gradientBackground
48 width: mainStatusLayout.width
49 opacity: qgcPal.windowTransparent.a
52 orientation: Gradient.Horizontal
53 GradientStop { position: 0; color: _mainStatusBGColor }
54 //GradientStop { position: qgcButton.x + qgcButton.width; color: _mainStatusBGColor }
55 GradientStop { position: 1; color: qgcPal.window }
59 // Standard toolbar background to the right of the gradient
61 anchors.left: gradientBackground.right
62 anchors.right: parent.right
64 color: qgcPal.windowTransparent
70 spacing: ScreenTools.defaultFontPixelWidth * 2
79 objectName: "toolbar_qgcLogo"
80 Layout.fillHeight: true
81 icon.source: "/res/QGCLogoFull.svg"
83 onClicked: mainWindow.showToolSelectDialog()
87 id: mainStatusIndicator
88 objectName: "toolbar_mainStatusIndicator"
89 Layout.fillHeight: true
95 text: qsTr("Disconnect")
96 onClicked: _activeVehicle.closeVehicle()
97 visible: _activeVehicle && _communicationLost
100 FlightModeIndicator {
101 objectName: "toolbar_flightModeIndicator"
102 Layout.fillHeight: true
103 visible: _activeVehicle
109 // center panel takes up all remaining space in toolbar between left and right panels
110 width: Math.max(guidedActionConfirm.visible ? guidedActionConfirm.width : 0, control.width - (leftPanel.width + rightPanel.width))
111 height: parent.height
115 color: qgcPal.windowTransparent
118 GuidedActionConfirm {
119 id: guidedActionConfirm
120 height: parent.height
121 anchors.horizontalCenter: parent.horizontalCenter
122 guidedController: control._guidedController
123 guidedValueSlider: control.guidedValueSlider
124 messageDisplay: guidedActionMessageDisplay
130 width: flyViewIndicators.width
131 height: parent.height
135 color: qgcPal.windowTransparent
138 FlyViewToolBarIndicators {
139 id: flyViewIndicators
140 height: parent.height
146 // The guided action message display is outside of the GuidedActionConfirm control so that it doesn't end up as
147 // part of the Flickable
149 id: guidedActionMessageDisplay
150 anchors.top: control.bottom
151 anchors.topMargin: _margins
152 x: control.mapFromItem(guidedActionConfirm.parent, guidedActionConfirm.x, 0).x + (guidedActionConfirm.width - guidedActionMessageDisplay.width) / 2
153 width: messageLabel.contentWidth + (_margins * 2)
154 height: messageLabel.contentHeight + (_margins * 2)
155 color: qgcPal.windowTransparent
156 radius: ScreenTools.defaultBorderRadius
157 visible: guidedActionConfirm.visible
163 width: ScreenTools.defaultFontPixelWidth * 30
164 wrapMode: Text.WordWrap
165 text: guidedActionConfirm.message
169 id: messageOpacityAnimation
170 target: guidedActionMessageDisplay
180 onTriggered: messageOpacityAnimation.start()
184 ParameterDownloadProgress {