diff --git a/src/FirmwarePlugin/FirmwarePlugin.cc b/src/FirmwarePlugin/FirmwarePlugin.cc index c09cf30f5620d77f76ee0bc44ed779c1bf706d6d..22d5f3d6399d8501e17c3db35cdf18be340925ce 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.cc +++ b/src/FirmwarePlugin/FirmwarePlugin.cc @@ -329,9 +329,9 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle) QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/RCRSSIIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/BatteryIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/GPSRTKIndicator.qml")), + QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ArmedIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ModeIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/VTOLModeIndicator.qml")), - QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ArmedIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MultiVehicleSelector.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/LinkIndicator.qml")), }); diff --git a/src/ui/toolbar/VTOLModeIndicator.qml b/src/ui/toolbar/VTOLModeIndicator.qml index a0e87cf427e60c5efbb236b4ec617bf719d62f59..4dc8d97f77d993bcf1028a8e45efa52aa7e088cf 100644 --- a/src/ui/toolbar/VTOLModeIndicator.qml +++ b/src/ui/toolbar/VTOLModeIndicator.qml @@ -19,21 +19,29 @@ import QGroundControl.Palette 1.0 //------------------------------------------------------------------------- //-- VTOL Mode Indicator -QGCLabel { +QGCComboBox { anchors.verticalCenter: parent.verticalCenter - verticalAlignment: Text.AlignVCenter - text: _fwdFlight ? qsTr("VTOL: Fixed Wing") : qsTr("VTOL: Multi-Rotor") + alternateText: _fwdFlight ? qsTr("VTOL: FW") : qsTr("VTOL: MR") + model: [ qsTr("VTOL: Multi-Rotor"), qsTr("VTOL: Fixed Wing") ] font.pointSize: ScreenTools.mediumFontPointSize - color: qgcPal.buttonText - width: implicitWidth + currentIndex: -1 + sizeToContents: true property bool showIndicator: _activeVehicle.vtol && _activeVehicle.px4Firmware - property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle - property bool _fwdFlight: _activeVehicle.vtolInFwdFlight + property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle + property bool _fwdFlight: _activeVehicle.vtolInFwdFlight - QGCMouseArea { - fillItem: parent - onClicked: activeVehicle.vtolInFwdFlight ? toolBar.vtolTransitionToMRFlight() : toolBar.vtolTransitionToFwdFlight() + onActivated: { + if (index == 0) { + if (_fwdFlight) { + mainWindow.vtolTransitionToMRFlight() + } + } else { + if (!_fwdFlight) { + mainWindow.vtolTransitionToFwdFlight() + } + } + currentIndex = -1 } }