Commit b1fcd835 authored by Pierre TILAK's avatar Pierre TILAK

Add Alt Instrument option in Fly View Settings

By default the Instrument Panel is the one from master,
It can be switched to alternate version by a checkbox in General Settings/Fly View
parent 2c303d69
......@@ -38,6 +38,7 @@ Item {
property bool _airspaceEnabled: QGroundControl.airmapSupported ? QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue : false
readonly property real _margins: ScreenTools.defaultFontPixelHeight * 0.5
readonly property bool _useAlternateInstrumentPanel: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel.value
QGCMapPalette { id: mapPal; lightColors: useLightColors }
......@@ -74,12 +75,21 @@ Item {
break;
}
} else {
instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidget.qml"
if(_useAlternateInstrumentPanel){
instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidgetAlternate.qml"
}
else{
instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidget.qml"
}
}
} else {
instrumentsLoader.source = ""
}
}
Connections {
target: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel
onValueChanged: _setInstrumentWidget()
}
Connections {
target: QGroundControl.settingsManager.appSettings.virtualJoystick
......
......@@ -18,5 +18,11 @@
"shortDescription": "Show/Hide Log Replay status bar",
"type": "bool",
"defaultValue": false
},
{
"name": "alternateInstrumentPanel",
"shortDescription": "Use Alternate Instrument Panel instead of the default one",
"type": "bool",
"defaultValue": false
}
]
......@@ -20,3 +20,4 @@ DECLARE_SETTINGGROUP(FlyView, "FlyView")
DECLARE_SETTINGSFACT(FlyViewSettings, guidedMinimumAltitude)
DECLARE_SETTINGSFACT(FlyViewSettings, guidedMaximumAltitude)
DECLARE_SETTINGSFACT(FlyViewSettings, showLogReplayStatusBar)
DECLARE_SETTINGSFACT(FlyViewSettings, alternateInstrumentPanel)
......@@ -22,4 +22,5 @@ public:
DEFINE_SETTINGFACT(guidedMinimumAltitude)
DEFINE_SETTINGFACT(guidedMaximumAltitude)
DEFINE_SETTINGFACT(showLogReplayStatusBar)
DEFINE_SETTINGFACT(alternateInstrumentPanel)
};
......@@ -461,6 +461,13 @@ Rectangle {
property Fact _virtualJoystickCentralized: QGroundControl.settingsManager.appSettings.virtualJoystickCentralized
}
FactCheckBox {
text: qsTr("Use Alternate Instrument Panel")
visible: _alternateInstrumentPanel.visible
fact: _alternateInstrumentPanel
property Fact _alternateInstrumentPanel: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel
}
GridLayout {
columns: 2
......
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