Commit abe955a5 authored by Gus Grubba's avatar Gus Grubba

Expose toolbar to plugin (replaceable)

Restore QGC to its normal UI layout (buttons on toolbar)
parent 75dcc988
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<file alias="FactSystemTest.qml">src/FactSystem/FactSystemTest.qml</file> <file alias="FactSystemTest.qml">src/FactSystem/FactSystemTest.qml</file>
</qresource> </qresource>
<qresource prefix="/toolbar"> <qresource prefix="/toolbar">
<file alias="MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file>
<file alias="ArmedIndicator.qml">src/ui/toolbar/ArmedIndicator.qml</file> <file alias="ArmedIndicator.qml">src/ui/toolbar/ArmedIndicator.qml</file>
<file alias="BatteryIndicator.qml">src/ui/toolbar/BatteryIndicator.qml</file> <file alias="BatteryIndicator.qml">src/ui/toolbar/BatteryIndicator.qml</file>
<file alias="GPSIndicator.qml">src/ui/toolbar/GPSIndicator.qml</file> <file alias="GPSIndicator.qml">src/ui/toolbar/GPSIndicator.qml</file>
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
<file alias="LinkSettings.qml">src/ui/preferences/LinkSettings.qml</file> <file alias="LinkSettings.qml">src/ui/preferences/LinkSettings.qml</file>
<file alias="LogDownloadPage.qml">src/AnalyzeView/LogDownloadPage.qml</file> <file alias="LogDownloadPage.qml">src/AnalyzeView/LogDownloadPage.qml</file>
<file alias="LogReplaySettings.qml">src/ui/preferences/LogReplaySettings.qml</file> <file alias="LogReplaySettings.qml">src/ui/preferences/LogReplaySettings.qml</file>
<file alias="MainQmlWindow.qml">src/ui/MainQmlWindow.qml</file> <file alias="MainRootWindow.qml">src/ui/MainRootWindow.qml</file>
<file alias="MavlinkConsolePage.qml">src/AnalyzeView/MavlinkConsolePage.qml</file> <file alias="MavlinkConsolePage.qml">src/AnalyzeView/MavlinkConsolePage.qml</file>
<file alias="MavlinkSettings.qml">src/ui/preferences/MavlinkSettings.qml</file> <file alias="MavlinkSettings.qml">src/ui/preferences/MavlinkSettings.qml</file>
<file alias="MissionSettingsEditor.qml">src/PlanView/MissionSettingsEditor.qml</file> <file alias="MissionSettingsEditor.qml">src/PlanView/MissionSettingsEditor.qml</file>
...@@ -76,8 +77,6 @@ ...@@ -76,8 +77,6 @@
<file alias="QGroundControl/Controls/GeoFenceMapVisuals.qml">src/PlanView/GeoFenceMapVisuals.qml</file> <file alias="QGroundControl/Controls/GeoFenceMapVisuals.qml">src/PlanView/GeoFenceMapVisuals.qml</file>
<file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file> <file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file>
<file alias="QGroundControl/Controls/JoystickThumbPad.qml">src/QmlControls/JoystickThumbPad.qml</file> <file alias="QGroundControl/Controls/JoystickThumbPad.qml">src/QmlControls/JoystickThumbPad.qml</file>
<file alias="QGroundControl/Controls/MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file>
<file alias="QGroundControl/Controls/MainToolBarIndicators.qml">src/ui/toolbar/MainToolBarIndicators.qml</file>
<file alias="QGroundControl/Controls/MissionCommandDialog.qml">src/QmlControls/MissionCommandDialog.qml</file> <file alias="QGroundControl/Controls/MissionCommandDialog.qml">src/QmlControls/MissionCommandDialog.qml</file>
<file alias="QGroundControl/Controls/MissionItemEditor.qml">src/PlanView/MissionItemEditor.qml</file> <file alias="QGroundControl/Controls/MissionItemEditor.qml">src/PlanView/MissionItemEditor.qml</file>
<file alias="QGroundControl/Controls/MissionItemIndexLabel.qml">src/QmlControls/MissionItemIndexLabel.qml</file> <file alias="QGroundControl/Controls/MissionItemIndexLabel.qml">src/QmlControls/MissionItemIndexLabel.qml</file>
......
...@@ -33,10 +33,10 @@ FactPanelController::FactPanelController() ...@@ -33,10 +33,10 @@ FactPanelController::FactPanelController()
void FactPanelController::_notifyPanelMissingParameter(const QString& missingParam) void FactPanelController::_notifyPanelMissingParameter(const QString& missingParam)
{ {
if (qgcApp()->mainQmlWindow()) { if (qgcApp()->mainRootWindow()) {
QVariant returnedValue; QVariant returnedValue;
QMetaObject::invokeMethod( QMetaObject::invokeMethod(
qgcApp()->mainQmlWindow(), qgcApp()->mainRootWindow(),
"showMissingParameterOverlay", "showMissingParameterOverlay",
Q_RETURN_ARG(QVariant, returnedValue), Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, missingParam)); Q_ARG(QVariant, missingParam));
...@@ -45,10 +45,10 @@ void FactPanelController::_notifyPanelMissingParameter(const QString& missingPar ...@@ -45,10 +45,10 @@ void FactPanelController::_notifyPanelMissingParameter(const QString& missingPar
void FactPanelController::_notifyPanelErrorMsg(const QString& errorMsg) void FactPanelController::_notifyPanelErrorMsg(const QString& errorMsg)
{ {
if(qgcApp()->mainQmlWindow()) { if(qgcApp()->mainRootWindow()) {
QVariant returnedValue; QVariant returnedValue;
QMetaObject::invokeMethod( QMetaObject::invokeMethod(
qgcApp()->mainQmlWindow(), qgcApp()->mainRootWindow(),
"showFactError", "showFactError",
Q_RETURN_ARG(QVariant, returnedValue), Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, errorMsg)); Q_ARG(QVariant, errorMsg));
...@@ -67,7 +67,7 @@ void FactPanelController::_reportMissingParameter(int componentId, const QString ...@@ -67,7 +67,7 @@ void FactPanelController::_reportMissingParameter(int componentId, const QString
// will not have access to _factPanel yet. Just record list of missing facts // will not have access to _factPanel yet. Just record list of missing facts
// in that case instead of notify. Once _factPanel is available they will be // in that case instead of notify. Once _factPanel is available they will be
// send out for real. // send out for real.
if (qgcApp()->mainQmlWindow()) { if (qgcApp()->mainRootWindow()) {
_notifyPanelMissingParameter(missingParam); _notifyPanelMissingParameter(missingParam);
} else { } else {
_delayedMissingParams += missingParam; _delayedMissingParams += missingParam;
......
...@@ -570,8 +570,8 @@ Item { ...@@ -570,8 +570,8 @@ Item {
z: _mapAndVideo.z + 4 z: _mapAndVideo.z + 4
title: qsTr("Fly") title: qsTr("Fly")
maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y
buttonVisible: [true, _useChecklist, _guidedController.showTakeoff || !_guidedController.showLand, _guidedController.showLand && !_guidedController.showTakeoff, true, true, true ] buttonVisible: [_useChecklist, _guidedController.showTakeoff || !_guidedController.showLand, _guidedController.showLand && !_guidedController.showTakeoff, true, true, true ]
buttonEnabled: [true, _useChecklist && activeVehicle, _guidedController.showTakeoff, _guidedController.showLand, _guidedController.showRTL, _guidedController.showPause, _anyActionAvailable ] buttonEnabled: [_useChecklist && activeVehicle, _guidedController.showTakeoff, _guidedController.showLand, _guidedController.showRTL, _guidedController.showPause, _anyActionAvailable ]
property bool _anyActionAvailable: _guidedController.showStartMission || _guidedController.showResumeMission || _guidedController.showChangeAlt || _guidedController.showLandAbort property bool _anyActionAvailable: _guidedController.showStartMission || _guidedController.showResumeMission || _guidedController.showChangeAlt || _guidedController.showLandAbort
property var _actionModel: [ property var _actionModel: [
...@@ -609,12 +609,8 @@ Item { ...@@ -609,12 +609,8 @@ Item {
model: [ model: [
{ {
name: "Plan", name: "Checklist",
iconSource: "/qmlimages/Plan.svg", iconSource: "/qmlimages/check.svg",
},
{
name: "Checklist",
iconSource: "/qmlimages/check.svg",
dropPanelComponent: checklistDropPanel dropPanelComponent: checklistDropPanel
}, },
{ {
...@@ -646,18 +642,13 @@ Item { ...@@ -646,18 +642,13 @@ Item {
onClicked: { onClicked: {
guidedActionsController.closeAll() guidedActionsController.closeAll()
if(index === 0) { var action = model[index].action
mainWindow.showPlanView() if (action === -1) {
guidedActionList.model = _actionModel
guidedActionList.visible = true
} else { } else {
var action = model[index].action _guidedController.confirmAction(action)
if (action === -1) {
guidedActionList.model = _actionModel
guidedActionList.visible = true
} else {
_guidedController.confirmAction(action)
}
} }
} }
} }
...@@ -689,7 +680,6 @@ Item { ...@@ -689,7 +680,6 @@ Item {
/// Close all dialogs /// Close all dialogs
function closeAll() { function closeAll() {
mainWindow.enableToolbar()
rootLoader.sourceComponent = null rootLoader.sourceComponent = null
guidedActionConfirm.visible = false guidedActionConfirm.visible = false
guidedActionList.visible = false guidedActionList.visible = false
......
...@@ -23,12 +23,12 @@ Rectangle { ...@@ -23,12 +23,12 @@ Rectangle {
property real missionMaxTelemetry: _controllerValid ? _planMasterController.missionController.missionMaxTelemetry : NaN property real missionMaxTelemetry: _controllerValid ? _planMasterController.missionController.missionMaxTelemetry : NaN
property bool missionDirty: _controllerValid ? _planMasterController.missionController.dirty : false property bool missionDirty: _controllerValid ? _planMasterController.missionController.dirty : false
property bool _controllerValid: _planMasterController !== undefined property bool _controllerValid: _planMasterController !== undefined && _planMasterController !== null
property bool _controllerOffline: _controllerValid ? _planMasterController.offline : true property bool _controllerOffline: _controllerValid ? _planMasterController.offline : true
property var _controllerDirty: _controllerValid ? _planMasterController.dirty : false property var _controllerDirty: _controllerValid ? _planMasterController.dirty : false
property var _controllerSyncInProgress: _controllerValid ? _planMasterController.syncInProgress : false property var _controllerSyncInProgress: _controllerValid ? _planMasterController.syncInProgress : false
property bool _statusValid: _currentMissionItem !== undefined property bool _statusValid: _currentMissionItem !== undefined && _currentMissionItem !== null
property bool _missionValid: missionItems !== undefined property bool _missionValid: missionItems !== undefined
property real _dataFontSize: ScreenTools.defaultFontPointSize property real _dataFontSize: ScreenTools.defaultFontPointSize
...@@ -77,6 +77,28 @@ Rectangle { ...@@ -77,6 +77,28 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
} }
//-- The reason for this Row to be here is so the Logo (Home) button is in the same
// location as the one in the main toolbar.
Row {
id: logoRow
anchors.bottomMargin: 1
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
QGCToolBarButton {
id: settingsButton
anchors.top: parent.top
anchors.bottom: parent.bottom
icon.source: "/qmlimages/PaperPlane.svg"
logo: true
checked: false
onClicked: {
checked = false
mainWindow.showFlyView()
}
}
}
// Progress bar // Progress bar
on_ControllerProgressPctChanged: { on_ControllerProgressPctChanged: {
......
...@@ -551,20 +551,16 @@ Item { ...@@ -551,20 +551,16 @@ Item {
color: qgcPal.window color: qgcPal.window
title: qsTr("Plan") title: qsTr("Plan")
z: QGroundControl.zOrderWidgets z: QGroundControl.zOrderWidgets
showAlternateIcon: [ false, _planMasterController.dirty, false, false, false, false, false, false ] showAlternateIcon: [ _planMasterController.dirty, false, false, false, false, false, false ]
rotateImage: [ false, _planMasterController.syncInProgress, false, false, false, false, false, false ] rotateImage: [ _planMasterController.syncInProgress, false, false, false, false, false, false ]
animateImage: [ false, _planMasterController.dirty, false, false, false, false, false, false ] animateImage: [ _planMasterController.dirty, false, false, false, false, false, false ]
buttonEnabled: [ true, !_planMasterController.syncInProgress, true, true, true, true, true, true ] buttonEnabled: [ !_planMasterController.syncInProgress, true, true, true, true, true, true ]
buttonVisible: [ true, true, true, _waypointsOnlyMode, true, true, _showZoom, _showZoom ] buttonVisible: [ true, true, _waypointsOnlyMode, true, true, _showZoom, _showZoom ]
maxHeight: mapScale.y - toolStrip.y maxHeight: mapScale.y - toolStrip.y
property bool _showZoom: !ScreenTools.isMobile property bool _showZoom: !ScreenTools.isMobile
model: [ model: [
{
name: qsTr("Fly"),
iconSource: "/qmlimages/PaperPlane.svg",
},
{ {
name: qsTr("File"), name: qsTr("File"),
iconSource: "/qmlimages/MapSync.svg", iconSource: "/qmlimages/MapSync.svg",
...@@ -603,26 +599,23 @@ Item { ...@@ -603,26 +599,23 @@ Item {
onClicked: { onClicked: {
switch (index) { switch (index) {
case 0: case 1:
mainWindow.showFlyView()
break;
case 2:
_addWaypointOnClick = checked _addWaypointOnClick = checked
_addROIOnClick = false _addROIOnClick = false
break break
case 3: case 2:
_addROIOnClick = checked _addROIOnClick = checked
_addWaypointOnClick = false _addWaypointOnClick = false
break break
case 4: case 3:
if (_singleComplexItem) { if (_singleComplexItem) {
addComplexItem(_missionController.complexMissionItemNames[0]) addComplexItem(_missionController.complexMissionItemNames[0])
} }
break break
case 6: case 5:
editorMap.zoomLevel += 0.5 editorMap.zoomLevel += 0.5
break break
case 7: case 6:
editorMap.zoomLevel -= 0.5 editorMap.zoomLevel -= 0.5
break break
} }
......
...@@ -654,12 +654,12 @@ void QGCApplication::showMessage(const QString& message) ...@@ -654,12 +654,12 @@ void QGCApplication::showMessage(const QString& message)
} }
} }
QQuickItem* QGCApplication::mainQmlWindow() QQuickItem* QGCApplication::mainRootWindow()
{ {
if(_mainQmlWindow) { if(_mainRootWindow) {
_mainQmlWindow = reinterpret_cast<QQuickItem*>(_rootQmlObject()); _mainRootWindow = reinterpret_cast<QQuickItem*>(_rootQmlObject());
} }
return _mainQmlWindow; return _mainRootWindow;
} }
void QGCApplication::showSetupView() void QGCApplication::showSetupView()
......
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
static QString cachedAirframeMetaDataFile(void); static QString cachedAirframeMetaDataFile(void);
void setLanguage(); void setLanguage();
QQuickItem* mainQmlWindow(); QQuickItem* mainRootWindow();
public slots: public slots:
/// You can connect to this slot to show an information message box from a different thread. /// You can connect to this slot to show an information message box from a different thread.
...@@ -180,7 +180,7 @@ private: ...@@ -180,7 +180,7 @@ private:
QGCFileDownload* _currentVersionDownload = nullptr; QGCFileDownload* _currentVersionDownload = nullptr;
GPSRTKFactGroup* _gpsRtkFactGroup = nullptr; GPSRTKFactGroup* _gpsRtkFactGroup = nullptr;
QGCToolbox* _toolbox = nullptr; QGCToolbox* _toolbox = nullptr;
QQuickItem* _mainQmlWindow = nullptr; QQuickItem* _mainRootWindow = nullptr;
bool _bluetoothAvailable = false; bool _bluetoothAvailable = false;
QTranslator _QGCTranslator; QTranslator _QGCTranslator;
......
...@@ -104,24 +104,24 @@ public: ...@@ -104,24 +104,24 @@ public:
DEFINE_QGC_COLOR(alertText, setAlertText) DEFINE_QGC_COLOR(alertText, setAlertText)
DEFINE_QGC_COLOR(missionItemEditor, setMissionItemEditor) DEFINE_QGC_COLOR(missionItemEditor, setMissionItemEditor)
QGCPalette(QObject* parent = NULL); QGCPalette(QObject* parent = nullptr);
~QGCPalette(); ~QGCPalette();
bool colorGroupEnabled (void) const { return _colorGroupEnabled; } bool colorGroupEnabled (void) const { return _colorGroupEnabled; }
void setColorGroupEnabled (bool enabled); void setColorGroupEnabled (bool enabled);
static Theme globalTheme (void) { return _theme; } static Theme globalTheme (void) { return _theme; }
static void setGlobalTheme (Theme newTheme); static void setGlobalTheme (Theme newTheme);
signals: signals:
void paletteChanged (); void paletteChanged ();
private: private:
static void _buildMap (void); static void _buildMap (void);
static void _signalPaletteChangeToAll (void); static void _signalPaletteChangeToAll (void);
void _signalPaletteChanged (void); void _signalPaletteChanged (void);
void _themeChanged (void); void _themeChanged (void);
static Theme _theme; ///< There is a single theme for all palettes static Theme _theme; ///< There is a single theme for all palettes
bool _colorGroupEnabled; ///< Currently selected ColorGroup. true: enabled, false: disabled bool _colorGroupEnabled; ///< Currently selected ColorGroup. true: enabled, false: disabled
......
...@@ -20,11 +20,13 @@ Button { ...@@ -20,11 +20,13 @@ Button {
height: ScreenTools.defaultFontPixelHeight * 3 height: ScreenTools.defaultFontPixelHeight * 3
autoExclusive: true autoExclusive: true
property bool logo: false
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
color: checked ? qgcPal.buttonHighlight : qgcPal.button color: logo ? qgcPal.brandingPurple : (checked ? qgcPal.buttonHighlight : Qt.rgba(0,0,0,0))
} }
contentItem: Row { contentItem: Row {
...@@ -38,12 +40,13 @@ Button { ...@@ -38,12 +40,13 @@ Button {
width: height width: height
sourceSize.height: parent.height sourceSize.height: parent.height
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText color: logo ? "white" : (button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText)
source: button.icon.source source: button.icon.source
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
Label { Label {
id: _label id: _label
visible: text !== ""
text: button.text text: button.text
color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
......
...@@ -20,7 +20,6 @@ GeoFenceMapVisuals 1.0 GeoFenceMapVisuals.qml ...@@ -20,7 +20,6 @@ GeoFenceMapVisuals 1.0 GeoFenceMapVisuals.qml
HackFileDialog 1.0 HackFileDialog.qml HackFileDialog 1.0 HackFileDialog.qml
IndicatorButton 1.0 IndicatorButton.qml IndicatorButton 1.0 IndicatorButton.qml
JoystickThumbPad 1.0 JoystickThumbPad.qml JoystickThumbPad 1.0 JoystickThumbPad.qml
MainToolBar 1.0 MainToolBar.qml
MissionCommandDialog 1.0 MissionCommandDialog.qml MissionCommandDialog 1.0 MissionCommandDialog.qml
MissionItemEditor 1.0 MissionItemEditor.qml MissionItemEditor 1.0 MissionItemEditor.qml
MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml
......
...@@ -230,7 +230,6 @@ Item { ...@@ -230,7 +230,6 @@ Item {
onAcceptedForLoad: { onAcceptedForLoad: {
if(!QGroundControl.mapEngineManager.importSets(file)) { if(!QGroundControl.mapEngineManager.importSets(file)) {
showList(); showList();
mainWindow.enableToolbar()
} }
close() close()
} }
...@@ -1143,7 +1142,6 @@ Item { ...@@ -1143,7 +1142,6 @@ Item {
visible: !QGroundControl.mapEngineManager.exporting visible: !QGroundControl.mapEngineManager.exporting
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
mainWindow.enableToolbar()
rootLoader.sourceComponent = null rootLoader.sourceComponent = null
} }
} }
...@@ -1227,7 +1225,6 @@ Item { ...@@ -1227,7 +1225,6 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
showList(); showList();
mainWindow.enableToolbar()
rootLoader.sourceComponent = null rootLoader.sourceComponent = null
} }
} }
...@@ -1250,7 +1247,6 @@ Item { ...@@ -1250,7 +1247,6 @@ Item {
width: _bigButtonSize * 1.25 width: _bigButtonSize * 1.25
onClicked: { onClicked: {
showList(); showList();
mainWindow.enableToolbar()
rootLoader.sourceComponent = null rootLoader.sourceComponent = null
} }
} }
......
...@@ -300,7 +300,7 @@ QQmlApplicationEngine* QGCCorePlugin::createRootWindow(QObject *parent) ...@@ -300,7 +300,7 @@ QQmlApplicationEngine* QGCCorePlugin::createRootWindow(QObject *parent)
pEngine->addImportPath("qrc:/qml"); pEngine->addImportPath("qrc:/qml");
pEngine->rootContext()->setContextProperty("joystickManager", qgcApp()->toolbox()->joystickManager()); pEngine->rootContext()->setContextProperty("joystickManager", qgcApp()->toolbox()->joystickManager());
pEngine->rootContext()->setContextProperty("debugMessageModel", AppMessages::getModel()); pEngine->rootContext()->setContextProperty("debugMessageModel", AppMessages::getModel());
pEngine->load(QUrl(QStringLiteral("qrc:/qml/MainQmlWindow.qml"))); pEngine->load(QUrl(QStringLiteral("qrc:/qml/MainRootWindow.qml")));
return pEngine; return pEngine;
} }
......
...@@ -31,9 +31,27 @@ QGCOptions::instrumentWidget() ...@@ -31,9 +31,27 @@ QGCOptions::instrumentWidget()
} }
QUrl QUrl
QGCOptions::mainToolbarIndicatorsUrl() const QGCOptions::mainToolbarUrl() const
{ {
return QUrl(QStringLiteral("qrc:/toolbar/MainToolBarIndicators.qml")); return QUrl(QStringLiteral("qrc:/toolbar/MainToolBar.qml"));
}
QUrl
QGCOptions::planToolbarUrl() const
{
return QUrl(QStringLiteral("qrc:/qml/PlanToolBar.qml"));
}
QColor
QGCOptions::toolbarBackgroundLight() const
{
return QColor(255,255,255,204);
}
QColor
QGCOptions::toolbarBackgroundDark() const
{
return QColor(0,0,0,192);
} }
QUrl QUrl
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QUrl> #include <QUrl>
#include <QColor>
/// @file /// @file
/// @brief Core Plugin Interface for QGroundControl - Application Options /// @brief Core Plugin Interface for QGroundControl - Application Options
...@@ -29,7 +30,12 @@ public: ...@@ -29,7 +30,12 @@ public:
Q_PROPERTY(bool enablePlanViewSelector READ enablePlanViewSelector CONSTANT) Q_PROPERTY(bool enablePlanViewSelector READ enablePlanViewSelector CONSTANT)
Q_PROPERTY(CustomInstrumentWidget* instrumentWidget READ instrumentWidget CONSTANT) Q_PROPERTY(CustomInstrumentWidget* instrumentWidget READ instrumentWidget CONSTANT)
Q_PROPERTY(QUrl flyViewOverlay READ flyViewOverlay CONSTANT) Q_PROPERTY(QUrl flyViewOverlay READ flyViewOverlay CONSTANT)
Q_PROPERTY(QUrl mainToolbarIndicatorsUrl READ mainToolbarIndicatorsUrl CONSTANT)
Q_PROPERTY(QUrl mainToolbarUrl READ mainToolbarUrl CONSTANT)
Q_PROPERTY(QUrl planToolbarUrl READ planToolbarUrl CONSTANT)
Q_PROPERTY(QColor toolbarBackgroundLight READ toolbarBackgroundLight CONSTANT)
Q_PROPERTY(QColor toolbarBackgroundDark READ toolbarBackgroundDark CONSTANT)
Q_PROPERTY(QUrl planToolbarIndicatorsUrl READ planToolbarIndicatorsUrl CONSTANT) Q_PROPERTY(QUrl planToolbarIndicatorsUrl READ planToolbarIndicatorsUrl CONSTANT)
Q_PROPERTY(bool showSensorCalibrationCompass READ showSensorCalibrationCompass NOTIFY showSensorCalibrationCompassChanged) Q_PROPERTY(bool showSensorCalibrationCompass READ showSensorCalibrationCompass NOTIFY showSensorCalibrationCompassChanged)
Q_PROPERTY(bool showSensorCalibrationGyro READ showSensorCalibrationGyro NOTIFY showSensorCalibrationGyroChanged) Q_PROPERTY(bool showSensorCalibrationGyro READ showSensorCalibrationGyro NOTIFY showSensorCalibrationGyroChanged)
...@@ -79,8 +85,11 @@ public: ...@@ -79,8 +85,11 @@ public:
/// Allows access to the full fly view window /// Allows access to the full fly view window
virtual QUrl flyViewOverlay () const { return QUrl(); } virtual QUrl flyViewOverlay () const { return QUrl(); }
/// Allows replacing the toolbar container /// Allows replacing the toolbar
virtual QUrl mainToolbarIndicatorsUrl () const; virtual QUrl mainToolbarUrl () const;
virtual QUrl planToolbarUrl () const;
virtual QColor toolbarBackgroundLight () const;
virtual QColor toolbarBackgroundDark () const;
/// Allows replacing the Plan View toolbar container /// Allows replacing the Plan View toolbar container
virtual QUrl planToolbarIndicatorsUrl () const; virtual QUrl planToolbarIndicatorsUrl () const;
/// By returning false you can hide the following sensor calibration pages /// By returning false you can hide the following sensor calibration pages
...@@ -157,7 +166,7 @@ public: ...@@ -157,7 +166,7 @@ public:
POS_BOTTOM_LEFT POS_BOTTOM_LEFT
}; };
Q_ENUM(Pos) Q_ENUM(Pos)
CustomInstrumentWidget(QObject* parent = NULL); CustomInstrumentWidget(QObject* parent = nullptr);
Q_PROPERTY(QUrl source READ source CONSTANT) Q_PROPERTY(QUrl source READ source CONSTANT)
Q_PROPERTY(Pos widgetPosition READ widgetPosition NOTIFY widgetPositionChanged) Q_PROPERTY(Pos widgetPosition READ widgetPosition NOTIFY widgetPositionChanged)
virtual QUrl source () { return QUrl(); } virtual QUrl source () { return QUrl(); }
......
...@@ -24,12 +24,12 @@ import QGroundControl.FlightMap 1.0 ...@@ -24,12 +24,12 @@ import QGroundControl.FlightMap 1.0
ApplicationWindow { ApplicationWindow {
id: mainWindow id: mainWindow
width: 1280 width: 1280
height: 1024 height: 720
visible: true visible: true
readonly property real _topBottomMargins: ScreenTools.defaultFontPixelHeight * 0.5 readonly property real _topBottomMargins: ScreenTools.defaultFontPixelHeight * 0.5
readonly property string _mainToolbarIndicators: QGroundControl.corePlugin.options.mainToolbarIndicatorsUrl readonly property string _mainToolbar: QGroundControl.corePlugin.options.mainToolbarUrl
readonly property string _planToolbarIndicators: QGroundControl.corePlugin.options.planToolbarIndicatorsUrl readonly property string _planToolbar: QGroundControl.corePlugin.options.planToolbarUrl
readonly property string _settingsViewSource: "AppSettings.qml" readonly property string _settingsViewSource: "AppSettings.qml"
readonly property string _setupViewSource: "SetupView.qml" readonly property string _setupViewSource: "SetupView.qml"
readonly property string _planViewSource: "PlanView.qml" readonly property string _planViewSource: "PlanView.qml"
...@@ -64,28 +64,18 @@ ApplicationWindow { ...@@ -64,28 +64,18 @@ ApplicationWindow {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- Global Scope Functions //-- Global Scope Functions
function disableToolbar() {
drawer.enabled = false
}
function enableToolbar() {
drawer.enabled = true
}
function viewSwitch(isPlanView) { function viewSwitch(isPlanView) {
enableToolbar()
drawer.close()
if(isPlanView) { if(isPlanView) {
rootBackground.visible = false rootBackground.visible = false
planViewLoader.visible = true planViewLoader.visible = true
if(toolbarIndicators.source !== _planToolbarIndicators) { if(toolbar.source !== _planToolbar) {
toolbarIndicators.source = _planToolbarIndicators toolbar.source = _planToolbar
} }
} else { } else {
rootBackground.visible = true rootBackground.visible = true
planViewLoader.visible = false planViewLoader.visible = false
if(toolbarIndicators.source !== _mainToolbarIndicators) { if(toolbar.source !== _mainToolbar) {
toolbarIndicators.source = _mainToolbarIndicators toolbar.source = _mainToolbar
} }
} }
} }
...@@ -93,9 +83,6 @@ ApplicationWindow { ...@@ -93,9 +83,6 @@ ApplicationWindow {
function showFlyView() { function showFlyView() {
viewSwitch(false) viewSwitch(false)
mainContentWindow.source = "" mainContentWindow.source = ""
if(toolbarIndicators.source !== _mainToolbarIndicators) {
toolbarIndicators.source = _mainToolbarIndicators
}
} }
function showPlanView() { function showPlanView() {
...@@ -297,169 +284,17 @@ ApplicationWindow { ...@@ -297,169 +284,17 @@ ApplicationWindow {
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- Global Indicator Bar //-- Toolbar
header: ToolBar { header: ToolBar {
height: ScreenTools.toolbarHeight height: ScreenTools.toolbarHeight
visible: !QGroundControl.videoManager.fullScreen visible: !QGroundControl.videoManager.fullScreen
background: Rectangle { background: Rectangle {
color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(1,1,1,0.8) : Qt.rgba(0,0,0,0.75) color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark
}
RowLayout {
anchors.fill: parent
spacing: 0
Rectangle {
height: parent.height
width: height
color: qgcPal.brandingPurple
QGCColoredImage {
anchors.centerIn: parent
height: ScreenTools.defaultFontPixelHeight * 2
width: height
sourceSize.height: parent.height
fillMode: Image.PreserveAspectFit
source: "/res/QGCLogoWhite"
color: "white"
}
MouseArea {
anchors.fill: parent
onClicked:{
if(drawer.visible) {
drawer.close()
} else {
drawer.open()
}
}
}
}
Loader {
id: toolbarIndicators
height: parent.height
source: _mainToolbarIndicators
Layout.fillWidth: true
}
}
}
//-------------------------------------------------------------------------
// Small parameter download progress bar
Rectangle {
x: 0
y: header.height
height: ScreenTools.toolbarHeight * 0.05
width: activeVehicle ? activeVehicle.parameterManager.loadProgress * mainWindow.width : 0
color: qgcPal.colorGreen
visible: !largeProgressBar.visible
}
//-------------------------------------------------------------------------
// Large parameter download progress bar
Rectangle {
id: largeProgressBar
x: 0
y: header.height
height: ScreenTools.toolbarHeight
width: mainWindow.width
color: qgcPal.window
visible: _showLargeProgress
property bool _initialDownloadComplete: activeVehicle ? activeVehicle.parameterManager.parametersReady : true
property bool _userHide: false
property bool _showLargeProgress: !_initialDownloadComplete && !_userHide && qgcPal.globalTheme === QGCPalette.Light
Connections {
target: QGroundControl.multiVehicleManager
onActiveVehicleChanged: largeProgressBar._userHide = false
}
Rectangle {
anchors.top: parent.top
anchors.bottom: parent.bottom
width: activeVehicle ? activeVehicle.parameterManager.loadProgress * mainWindow.width : 0
color: qgcPal.colorGreen
}
QGCLabel {
anchors.centerIn: parent
text: qsTr("Downloading Parameters")
font.pointSize: ScreenTools.largeFontPointSize
}
QGCLabel {
anchors.margins: _margin
anchors.right: parent.right
anchors.bottom: parent.bottom
text: qsTr("Click anywhere to hide")
property real _margin: ScreenTools.defaultFontPixelWidth * 0.5
} }
MouseArea { Loader {
id: toolbar
anchors.fill: parent anchors.fill: parent
onClicked: largeProgressBar._userHide = true source: _mainToolbar
}
}
//-------------------------------------------------------------------------
//-- Navigation Drawer (Left to Right, on command or using touch gestures)
Drawer {
id: drawer
y: header.height
width: navButtonWidth
height: mainWindow.height - header.height
background: Rectangle {
color: qgcPal.globalTheme === QGCPalette.Light ? "white" : "black"
}
ButtonGroup {
buttons: buttons.children
}
ColumnLayout {
id: buttons
anchors.top: parent.top
anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left
anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelHeight * 0.5
QGCToolBarButton {
text: "Fly"
icon.source: "/qmlimages/PaperPlane.svg"
Layout.fillWidth: true
onClicked: {
checked = true
showFlyView()
}
}
QGCToolBarButton {
text: "Plan"
icon.source: "/qmlimages/Plan.svg"
Layout.fillWidth: true
onClicked: {
checked = true
showPlanView()
}
}
QGCToolBarButton {
text: "Analyze"
icon.source: "/qmlimages/Analyze.svg"
Layout.fillWidth: true
onClicked: {
checked = true
showAnalyzeView()
}
}
QGCToolBarButton {
text: "Vehicle Setup"
icon.source: "/qmlimages/Gears.svg"
Layout.fillWidth: true
onClicked: {
checked = true
showSetupView()
}
}
QGCToolBarButton {
text: "Settings"
icon.source: "/qmlimages/Gears.svg"
Layout.fillWidth: true
onClicked: {
checked = true
showSettingsView()
}
}
} }
} }
...@@ -472,7 +307,7 @@ ApplicationWindow { ...@@ -472,7 +307,7 @@ ApplicationWindow {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- Loader helper for any child, no matter how deep can display an element //-- Loader helper for any child, no matter how deep can display an element
// in the middle of the main window. // on top of the main window.
Loader { Loader {
id: rootLoader id: rootLoader
anchors.centerIn: parent anchors.centerIn: parent
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1024</width>
<height>600</height>
</rect>
</property>
<property name="baseSize">
<size>
<width>1100</width>
<height>800</height>
</size>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="windowTitle">
<string>MGMainWindow</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QWidget" name="centralWidget"/>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1024</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="separator"/>
<addaction name="actionStatusBar"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuWidgets">
<property name="title">
<string>Widgets</string>
</property>
</widget>
<addaction name="menuFile"/>
<addaction name="menuWidgets"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionExit">
<property name="text">
<string>Exit</string>
</property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
<action name="actionAdd_Link">
<property name="text">
<string>Manage Communication Links</string>
</property>
</action>
<action name="actionAdvanced_Mode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Advanced Mode</string>
</property>
</action>
<action name="actionStatusBar">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Replay Flight Data</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections>
<connection>
<sender>actionExit</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>299</x>
<y>199</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.2
import QGroundControl 1.0
import QGroundControl.Controls 1.0
/// Native QML top level window
Item {
function showSetupView() {
mainWindowInner.item.showSetupView()
}
function attemptWindowClose() {
if(!mainWindowInner.item) {
controller.reallyClose()
} else {
mainWindowInner.item.attemptWindowClose()
}
}
function showMessage(message) {
if(mainWindowInner.item) {
mainWindowInner.item.showMessage(message)
} else {
console.log(message)
}
}
Loader {
id: mainWindowInner
anchors.fill: parent
source: "MainWindowInner.qml"
Connections {
target: mainWindowInner.item
onReallyClose: controller.reallyClose()
}
}
}
This diff is collapsed.
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
* *
****************************************************************************/ ****************************************************************************/
import QtQuick 2.3 import QtQuick 2.11
import QtQuick.Layouts 1.2 import QtQuick.Controls 2.4
import QtQuick.Controls 1.2 import QtQuick.Layouts 1.11
import QGroundControl 1.0 import QGroundControl 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
...@@ -18,55 +18,14 @@ import QGroundControl.MultiVehicleManager 1.0 ...@@ -18,55 +18,14 @@ import QGroundControl.MultiVehicleManager 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
Rectangle { Item {
id: toolBar id: toolBar
color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(1,1,1,0.8) : Qt.rgba(0,0,0,0.75)
visible: !QGroundControl.videoManager.fullScreen
QGCPalette { id: qgcPal; colorGroupEnabled: true }
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
signal showSettingsView
signal showSetupView
signal showPlanView
signal showFlyView
signal showAnalyzeView
signal armVehicle
signal disarmVehicle
signal vtolTransitionToFwdFlight
signal vtolTransitionToMRFlight
function checkSettingsButton() {
settingsButton.checked = true
}
function checkSetupButton() {
setupButton.checked = true
}
function checkPlanButton() {
planButton.checked = true
}
function checkFlyButton() {
flyButton.checked = true
}
function checkAnalyzeButton() {
analyzeButton.checked = true
}
Component.onCompleted: { Component.onCompleted: {
//-- TODO: Get this from the actual state //-- TODO: Get this from the actual state
flyButton.checked = true flyButton.checked = true
} }
// Prevent all clicks from going through to lower layers
DeadMouseArea {
anchors.fill: parent
}
/// Bottom single pixel divider /// Bottom single pixel divider
Rectangle { Rectangle {
anchors.left: parent.left anchors.left: parent.left
...@@ -83,6 +42,10 @@ Rectangle { ...@@ -83,6 +42,10 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
spacing: ScreenTools.defaultFontPixelWidth * 2 spacing: ScreenTools.defaultFontPixelWidth * 2
ButtonGroup {
buttons: viewRow.children
}
//--------------------------------------------- //---------------------------------------------
// Toolbar Row // Toolbar Row
Row { Row {
...@@ -90,54 +53,62 @@ Rectangle { ...@@ -90,54 +53,62 @@ Rectangle {
Layout.fillHeight: true Layout.fillHeight: true
spacing: ScreenTools.defaultFontPixelWidth / 2 spacing: ScreenTools.defaultFontPixelWidth / 2
ExclusiveGroup { id: mainActionGroup }
QGCToolBarButton { QGCToolBarButton {
id: settingsButton id: settingsButton
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
exclusiveGroup: mainActionGroup icon.source: "/res/QGCLogoWhite"
source: "/res/QGCLogoWhite"
logo: true logo: true
onClicked: toolBar.showSettingsView()
visible: !QGroundControl.corePlugin.options.combineSettingsAndSetup visible: !QGroundControl.corePlugin.options.combineSettingsAndSetup
onClicked: {
checked = true
mainWindow.showSettingsView()
}
} }
QGCToolBarButton { QGCToolBarButton {
id: setupButton id: setupButton
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
exclusiveGroup: mainActionGroup icon.source: "/qmlimages/Gears.svg"
source: "/qmlimages/Gears.svg" onClicked: {
onClicked: toolBar.showSetupView() checked = true
mainWindow.showSetupView()
}
} }
QGCToolBarButton { QGCToolBarButton {
id: planButton id: planButton
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
exclusiveGroup: mainActionGroup icon.source: "/qmlimages/Plan.svg"
source: "/qmlimages/Plan.svg" onClicked: {
onClicked: toolBar.showPlanView() checked = true
mainWindow.showPlanView()
}
} }
QGCToolBarButton { QGCToolBarButton {
id: flyButton id: flyButton
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
exclusiveGroup: mainActionGroup icon.source: "/qmlimages/PaperPlane.svg"
source: "/qmlimages/PaperPlane.svg" onClicked: {
onClicked: toolBar.showFlyView() checked = true
mainWindow.showFlyView()
}
} }
QGCToolBarButton { QGCToolBarButton {
id: analyzeButton id: analyzeButton
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
exclusiveGroup: mainActionGroup icon.source: "/qmlimages/Analyze.svg"
source: "/qmlimages/Analyze.svg"
visible: QGroundControl.corePlugin.showAdvancedUI visible: QGroundControl.corePlugin.showAdvancedUI
onClicked: toolBar.showAnalyzeView() onClicked: {
checked = true
mainWindow.showAnalyzeView()
}
} }
Rectangle { Rectangle {
...@@ -146,67 +117,15 @@ Rectangle { ...@@ -146,67 +117,15 @@ Rectangle {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: 1 width: 1
color: qgcPal.text color: qgcPal.text
visible: _activeVehicle visible: activeVehicle
}
}
//-------------------------------------------------------------------------
//-- Vehicle Selector
QGCButton {
id: vehicleSelectorButton
width: ScreenTools.defaultFontPixelHeight * 8
text: "Vehicle " + (_activeVehicle ? _activeVehicle.id : "None")
visible: QGroundControl.multiVehicleManager.vehicles.count > 1
Layout.alignment: Qt.AlignVCenter
menu: vehicleMenu
Menu {
id: vehicleMenu
}
Component {
id: vehicleMenuItemComponent
MenuItem {
onTriggered: QGroundControl.multiVehicleManager.activeVehicle = vehicle
property int vehicleId: Number(text.split(" ")[1])
property var vehicle: QGroundControl.multiVehicleManager.getVehicleById(vehicleId)
}
}
property var vehicleMenuItems: []
function updateVehicleMenu() {
var i;
// Remove old menu items
for (i = 0; i < vehicleMenuItems.length; i++) {
vehicleMenu.removeItem(vehicleMenuItems[i])
}
vehicleMenuItems.length = 0
// Add new items
for (i = 0; i < QGroundControl.multiVehicleManager.vehicles.count; i++) {
var vehicle = QGroundControl.multiVehicleManager.vehicles.get(i)
var menuItem = vehicleMenuItemComponent.createObject(null, { "text": "Vehicle " + vehicle.id })
vehicleMenuItems.push(menuItem)
vehicleMenu.insertItem(i, menuItem)
}
}
Component.onCompleted: updateVehicleMenu()
Connections {
target: QGroundControl.multiVehicleManager.vehicles
onCountChanged: vehicleSelectorButton.updateVehicleMenu()
} }
} }
MainToolBarIndicators { Loader {
id: toolbarIndicators
height: parent.height
source: "/toolbar/MainToolBarIndicators.qml"
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: ScreenTools.defaultFontPixelHeight * 0.66
} }
} }
...@@ -214,7 +133,7 @@ Rectangle { ...@@ -214,7 +133,7 @@ Rectangle {
Rectangle { Rectangle {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
height: toolBar.height * 0.05 height: toolBar.height * 0.05
width: _activeVehicle ? _activeVehicle.parameterManager.loadProgress * parent.width : 0 width: activeVehicle ? activeVehicle.parameterManager.loadProgress * parent.width : 0
color: qgcPal.colorGreen color: qgcPal.colorGreen
visible: !largeProgressBar.visible visible: !largeProgressBar.visible
} }
...@@ -229,7 +148,7 @@ Rectangle { ...@@ -229,7 +148,7 @@ Rectangle {
color: qgcPal.window color: qgcPal.window
visible: _showLargeProgress visible: _showLargeProgress
property bool _initialDownloadComplete: _activeVehicle ? _activeVehicle.parameterManager.parametersReady : true property bool _initialDownloadComplete: activeVehicle ? activeVehicle.parameterManager.parametersReady : true
property bool _userHide: false property bool _userHide: false
property bool _showLargeProgress: !_initialDownloadComplete && !_userHide && qgcPal.globalTheme === QGCPalette.Light property bool _showLargeProgress: !_initialDownloadComplete && !_userHide && qgcPal.globalTheme === QGCPalette.Light
...@@ -241,7 +160,7 @@ Rectangle { ...@@ -241,7 +160,7 @@ Rectangle {
Rectangle { Rectangle {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: _activeVehicle ? _activeVehicle.parameterManager.loadProgress * parent.width : 0 width: activeVehicle ? activeVehicle.parameterManager.loadProgress * parent.width : 0
color: qgcPal.colorGreen color: qgcPal.colorGreen
} }
......
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