Unverified Commit 6a1344a4 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8102 from DonLakeFlyer/VTOLIndicator

Toolbar indicators: Change order, Change VTOL indicator
parents a5a99be2 961eac7b
...@@ -329,9 +329,9 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle) ...@@ -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/RCRSSIIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/BatteryIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/BatteryIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/GPSRTKIndicator.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/ModeIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/VTOLModeIndicator.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/MultiVehicleSelector.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/LinkIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/LinkIndicator.qml")),
}); });
......
...@@ -19,21 +19,29 @@ import QGroundControl.Palette 1.0 ...@@ -19,21 +19,29 @@ import QGroundControl.Palette 1.0
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- VTOL Mode Indicator //-- VTOL Mode Indicator
QGCLabel { QGCComboBox {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
verticalAlignment: Text.AlignVCenter alternateText: _fwdFlight ? qsTr("VTOL: FW") : qsTr("VTOL: MR")
text: _fwdFlight ? qsTr("VTOL: Fixed Wing") : qsTr("VTOL: Multi-Rotor") model: [ qsTr("VTOL: Multi-Rotor"), qsTr("VTOL: Fixed Wing") ]
font.pointSize: ScreenTools.mediumFontPointSize font.pointSize: ScreenTools.mediumFontPointSize
color: qgcPal.buttonText currentIndex: -1
width: implicitWidth sizeToContents: true
property bool showIndicator: _activeVehicle.vtol && _activeVehicle.px4Firmware property bool showIndicator: _activeVehicle.vtol && _activeVehicle.px4Firmware
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _fwdFlight: _activeVehicle.vtolInFwdFlight property bool _fwdFlight: _activeVehicle.vtolInFwdFlight
QGCMouseArea { onActivated: {
fillItem: parent if (index == 0) {
onClicked: activeVehicle.vtolInFwdFlight ? toolBar.vtolTransitionToMRFlight() : toolBar.vtolTransitionToFwdFlight() if (_fwdFlight) {
mainWindow.vtolTransitionToMRFlight()
}
} else {
if (!_fwdFlight) {
mainWindow.vtolTransitionToFwdFlight()
}
}
currentIndex = -1
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment