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 @@
<file alias="FactSystemTest.qml">src/FactSystem/FactSystemTest.qml</file>
</qresource>
<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="BatteryIndicator.qml">src/ui/toolbar/BatteryIndicator.qml</file>
<file alias="GPSIndicator.qml">src/ui/toolbar/GPSIndicator.qml</file>
......@@ -48,7 +49,7 @@
<file alias="LinkSettings.qml">src/ui/preferences/LinkSettings.qml</file>
<file alias="LogDownloadPage.qml">src/AnalyzeView/LogDownloadPage.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="MavlinkSettings.qml">src/ui/preferences/MavlinkSettings.qml</file>
<file alias="MissionSettingsEditor.qml">src/PlanView/MissionSettingsEditor.qml</file>
......@@ -76,8 +77,6 @@
<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/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/MissionItemEditor.qml">src/PlanView/MissionItemEditor.qml</file>
<file alias="QGroundControl/Controls/MissionItemIndexLabel.qml">src/QmlControls/MissionItemIndexLabel.qml</file>
......
......@@ -33,10 +33,10 @@ FactPanelController::FactPanelController()
void FactPanelController::_notifyPanelMissingParameter(const QString& missingParam)
{
if (qgcApp()->mainQmlWindow()) {
if (qgcApp()->mainRootWindow()) {
QVariant returnedValue;
QMetaObject::invokeMethod(
qgcApp()->mainQmlWindow(),
qgcApp()->mainRootWindow(),
"showMissingParameterOverlay",
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, missingParam));
......@@ -45,10 +45,10 @@ void FactPanelController::_notifyPanelMissingParameter(const QString& missingPar
void FactPanelController::_notifyPanelErrorMsg(const QString& errorMsg)
{
if(qgcApp()->mainQmlWindow()) {
if(qgcApp()->mainRootWindow()) {
QVariant returnedValue;
QMetaObject::invokeMethod(
qgcApp()->mainQmlWindow(),
qgcApp()->mainRootWindow(),
"showFactError",
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, errorMsg));
......@@ -67,7 +67,7 @@ void FactPanelController::_reportMissingParameter(int componentId, const QString
// 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
// send out for real.
if (qgcApp()->mainQmlWindow()) {
if (qgcApp()->mainRootWindow()) {
_notifyPanelMissingParameter(missingParam);
} else {
_delayedMissingParams += missingParam;
......
......@@ -570,8 +570,8 @@ Item {
z: _mapAndVideo.z + 4
title: qsTr("Fly")
maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y
buttonVisible: [true, _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 ]
buttonVisible: [_useChecklist, _guidedController.showTakeoff || !_guidedController.showLand, _guidedController.showLand && !_guidedController.showTakeoff, true, true, true ]
buttonEnabled: [_useChecklist && activeVehicle, _guidedController.showTakeoff, _guidedController.showLand, _guidedController.showRTL, _guidedController.showPause, _anyActionAvailable ]
property bool _anyActionAvailable: _guidedController.showStartMission || _guidedController.showResumeMission || _guidedController.showChangeAlt || _guidedController.showLandAbort
property var _actionModel: [
......@@ -609,12 +609,8 @@ Item {
model: [
{
name: "Plan",
iconSource: "/qmlimages/Plan.svg",
},
{
name: "Checklist",
iconSource: "/qmlimages/check.svg",
name: "Checklist",
iconSource: "/qmlimages/check.svg",
dropPanelComponent: checklistDropPanel
},
{
......@@ -646,18 +642,13 @@ Item {
onClicked: {
guidedActionsController.closeAll()
if(index === 0) {
mainWindow.showPlanView()
var action = model[index].action
if (action === -1) {
guidedActionList.model = _actionModel
guidedActionList.visible = true
} else {
var action = model[index].action
if (action === -1) {
guidedActionList.model = _actionModel
guidedActionList.visible = true
} else {
_guidedController.confirmAction(action)
}
_guidedController.confirmAction(action)
}
}
}
......@@ -689,7 +680,6 @@ Item {
/// Close all dialogs
function closeAll() {
mainWindow.enableToolbar()
rootLoader.sourceComponent = null
guidedActionConfirm.visible = false
guidedActionList.visible = false
......
......@@ -23,12 +23,12 @@ Rectangle {
property real missionMaxTelemetry: _controllerValid ? _planMasterController.missionController.missionMaxTelemetry : NaN
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 var _controllerDirty: _controllerValid ? _planMasterController.dirty : 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 real _dataFontSize: ScreenTools.defaultFontPointSize
......@@ -77,6 +77,28 @@ Rectangle {
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
on_ControllerProgressPctChanged: {
......
......@@ -551,20 +551,16 @@ Item {
color: qgcPal.window
title: qsTr("Plan")
z: QGroundControl.zOrderWidgets
showAlternateIcon: [ false, _planMasterController.dirty, false, false, false, false, false, false ]
rotateImage: [ false, _planMasterController.syncInProgress, false, false, false, false, false, false ]
animateImage: [ false, _planMasterController.dirty, false, false, false, false, false, false ]
buttonEnabled: [ true, !_planMasterController.syncInProgress, true, true, true, true, true, true ]
buttonVisible: [ true, true, true, _waypointsOnlyMode, true, true, _showZoom, _showZoom ]
showAlternateIcon: [ _planMasterController.dirty, false, false, false, false, false, false ]
rotateImage: [ _planMasterController.syncInProgress, false, false, false, false, false, false ]
animateImage: [ _planMasterController.dirty, false, false, false, false, false, false ]
buttonEnabled: [ !_planMasterController.syncInProgress, true, true, true, true, true, true ]
buttonVisible: [ true, true, _waypointsOnlyMode, true, true, _showZoom, _showZoom ]
maxHeight: mapScale.y - toolStrip.y
property bool _showZoom: !ScreenTools.isMobile
model: [
{
name: qsTr("Fly"),
iconSource: "/qmlimages/PaperPlane.svg",
},
{
name: qsTr("File"),
iconSource: "/qmlimages/MapSync.svg",
......@@ -603,26 +599,23 @@ Item {
onClicked: {
switch (index) {
case 0:
mainWindow.showFlyView()
break;
case 2:
case 1:
_addWaypointOnClick = checked
_addROIOnClick = false
break
case 3:
case 2:
_addROIOnClick = checked
_addWaypointOnClick = false
break
case 4:
case 3:
if (_singleComplexItem) {
addComplexItem(_missionController.complexMissionItemNames[0])
}
break
case 6:
case 5:
editorMap.zoomLevel += 0.5
break
case 7:
case 6:
editorMap.zoomLevel -= 0.5
break
}
......
......@@ -654,12 +654,12 @@ void QGCApplication::showMessage(const QString& message)
}
}
QQuickItem* QGCApplication::mainQmlWindow()
QQuickItem* QGCApplication::mainRootWindow()
{
if(_mainQmlWindow) {
_mainQmlWindow = reinterpret_cast<QQuickItem*>(_rootQmlObject());
if(_mainRootWindow) {
_mainRootWindow = reinterpret_cast<QQuickItem*>(_rootQmlObject());
}
return _mainQmlWindow;
return _mainRootWindow;
}
void QGCApplication::showSetupView()
......
......@@ -96,7 +96,7 @@ public:
static QString cachedAirframeMetaDataFile(void);
void setLanguage();
QQuickItem* mainQmlWindow();
QQuickItem* mainRootWindow();
public slots:
/// You can connect to this slot to show an information message box from a different thread.
......@@ -180,7 +180,7 @@ private:
QGCFileDownload* _currentVersionDownload = nullptr;
GPSRTKFactGroup* _gpsRtkFactGroup = nullptr;
QGCToolbox* _toolbox = nullptr;
QQuickItem* _mainQmlWindow = nullptr;
QQuickItem* _mainRootWindow = nullptr;
bool _bluetoothAvailable = false;
QTranslator _QGCTranslator;
......
......@@ -104,24 +104,24 @@ public:
DEFINE_QGC_COLOR(alertText, setAlertText)
DEFINE_QGC_COLOR(missionItemEditor, setMissionItemEditor)
QGCPalette(QObject* parent = NULL);
QGCPalette(QObject* parent = nullptr);
~QGCPalette();
bool colorGroupEnabled (void) const { return _colorGroupEnabled; }
void setColorGroupEnabled (bool enabled);
static Theme globalTheme (void) { return _theme; }
static void setGlobalTheme (Theme newTheme);
signals:
void paletteChanged ();
private:
static void _buildMap (void);
static void _signalPaletteChangeToAll (void);
void _signalPaletteChanged (void);
void _themeChanged (void);
static Theme _theme; ///< There is a single theme for all palettes
bool _colorGroupEnabled; ///< Currently selected ColorGroup. true: enabled, false: disabled
......
......@@ -20,11 +20,13 @@ Button {
height: ScreenTools.defaultFontPixelHeight * 3
autoExclusive: true
property bool logo: false
QGCPalette { id: qgcPal }
background: Rectangle {
anchors.fill: parent
color: checked ? qgcPal.buttonHighlight : qgcPal.button
color: logo ? qgcPal.brandingPurple : (checked ? qgcPal.buttonHighlight : Qt.rgba(0,0,0,0))
}
contentItem: Row {
......@@ -38,12 +40,13 @@ Button {
width: height
sourceSize.height: parent.height
fillMode: Image.PreserveAspectFit
color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
color: logo ? "white" : (button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText)
source: button.icon.source
anchors.verticalCenter: parent.verticalCenter
}
Label {
id: _label
visible: text !== ""
text: button.text
color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
anchors.verticalCenter: parent.verticalCenter
......
......@@ -20,7 +20,6 @@ GeoFenceMapVisuals 1.0 GeoFenceMapVisuals.qml
HackFileDialog 1.0 HackFileDialog.qml
IndicatorButton 1.0 IndicatorButton.qml
JoystickThumbPad 1.0 JoystickThumbPad.qml
MainToolBar 1.0 MainToolBar.qml
MissionCommandDialog 1.0 MissionCommandDialog.qml
MissionItemEditor 1.0 MissionItemEditor.qml
MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml
......
......@@ -230,7 +230,6 @@ Item {
onAcceptedForLoad: {
if(!QGroundControl.mapEngineManager.importSets(file)) {
showList();
mainWindow.enableToolbar()
}
close()
}
......@@ -1143,7 +1142,6 @@ Item {
visible: !QGroundControl.mapEngineManager.exporting
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
mainWindow.enableToolbar()
rootLoader.sourceComponent = null
}
}
......@@ -1227,7 +1225,6 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
showList();
mainWindow.enableToolbar()
rootLoader.sourceComponent = null
}
}
......@@ -1250,7 +1247,6 @@ Item {
width: _bigButtonSize * 1.25
onClicked: {
showList();
mainWindow.enableToolbar()
rootLoader.sourceComponent = null
}
}
......
......@@ -300,7 +300,7 @@ QQmlApplicationEngine* QGCCorePlugin::createRootWindow(QObject *parent)
pEngine->addImportPath("qrc:/qml");
pEngine->rootContext()->setContextProperty("joystickManager", qgcApp()->toolbox()->joystickManager());
pEngine->rootContext()->setContextProperty("debugMessageModel", AppMessages::getModel());
pEngine->load(QUrl(QStringLiteral("qrc:/qml/MainQmlWindow.qml")));
pEngine->load(QUrl(QStringLiteral("qrc:/qml/MainRootWindow.qml")));
return pEngine;
}
......
......@@ -31,9 +31,27 @@ QGCOptions::instrumentWidget()
}
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
......
......@@ -12,6 +12,7 @@
#include <QObject>
#include <QString>
#include <QUrl>
#include <QColor>
/// @file
/// @brief Core Plugin Interface for QGroundControl - Application Options
......@@ -29,7 +30,12 @@ public:
Q_PROPERTY(bool enablePlanViewSelector READ enablePlanViewSelector CONSTANT)
Q_PROPERTY(CustomInstrumentWidget* instrumentWidget READ instrumentWidget 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(bool showSensorCalibrationCompass READ showSensorCalibrationCompass NOTIFY showSensorCalibrationCompassChanged)
Q_PROPERTY(bool showSensorCalibrationGyro READ showSensorCalibrationGyro NOTIFY showSensorCalibrationGyroChanged)
......@@ -79,8 +85,11 @@ public:
/// Allows access to the full fly view window
virtual QUrl flyViewOverlay () const { return QUrl(); }
/// Allows replacing the toolbar container
virtual QUrl mainToolbarIndicatorsUrl () const;
/// Allows replacing the toolbar
virtual QUrl mainToolbarUrl () const;
virtual QUrl planToolbarUrl () const;
virtual QColor toolbarBackgroundLight () const;
virtual QColor toolbarBackgroundDark () const;
/// Allows replacing the Plan View toolbar container
virtual QUrl planToolbarIndicatorsUrl () const;
/// By returning false you can hide the following sensor calibration pages
......@@ -157,7 +166,7 @@ public:
POS_BOTTOM_LEFT
};
Q_ENUM(Pos)
CustomInstrumentWidget(QObject* parent = NULL);
CustomInstrumentWidget(QObject* parent = nullptr);
Q_PROPERTY(QUrl source READ source CONSTANT)
Q_PROPERTY(Pos widgetPosition READ widgetPosition NOTIFY widgetPositionChanged)
virtual QUrl source () { return QUrl(); }
......
......@@ -24,12 +24,12 @@ import QGroundControl.FlightMap 1.0
ApplicationWindow {
id: mainWindow
width: 1280
height: 1024
height: 720
visible: true
readonly property real _topBottomMargins: ScreenTools.defaultFontPixelHeight * 0.5
readonly property string _mainToolbarIndicators: QGroundControl.corePlugin.options.mainToolbarIndicatorsUrl
readonly property string _planToolbarIndicators: QGroundControl.corePlugin.options.planToolbarIndicatorsUrl
readonly property string _mainToolbar: QGroundControl.corePlugin.options.mainToolbarUrl
readonly property string _planToolbar: QGroundControl.corePlugin.options.planToolbarUrl
readonly property string _settingsViewSource: "AppSettings.qml"
readonly property string _setupViewSource: "SetupView.qml"
readonly property string _planViewSource: "PlanView.qml"
......@@ -64,28 +64,18 @@ ApplicationWindow {
//-------------------------------------------------------------------------
//-- Global Scope Functions
function disableToolbar() {
drawer.enabled = false
}
function enableToolbar() {
drawer.enabled = true
}
function viewSwitch(isPlanView) {
enableToolbar()
drawer.close()
if(isPlanView) {
rootBackground.visible = false
planViewLoader.visible = true
if(toolbarIndicators.source !== _planToolbarIndicators) {
toolbarIndicators.source = _planToolbarIndicators
if(toolbar.source !== _planToolbar) {
toolbar.source = _planToolbar
}
} else {
rootBackground.visible = true
planViewLoader.visible = false
if(toolbarIndicators.source !== _mainToolbarIndicators) {
toolbarIndicators.source = _mainToolbarIndicators
if(toolbar.source !== _mainToolbar) {
toolbar.source = _mainToolbar
}
}
}
......@@ -93,9 +83,6 @@ ApplicationWindow {
function showFlyView() {
viewSwitch(false)
mainContentWindow.source = ""
if(toolbarIndicators.source !== _mainToolbarIndicators) {
toolbarIndicators.source = _mainToolbarIndicators
}
}
function showPlanView() {
......@@ -297,169 +284,17 @@ ApplicationWindow {
}
//-------------------------------------------------------------------------
//-- Global Indicator Bar
//-- Toolbar
header: ToolBar {
height: ScreenTools.toolbarHeight
visible: !QGroundControl.videoManager.fullScreen
background: Rectangle {
color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(1,1,1,0.8) : Qt.rgba(0,0,0,0.75)
}
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
color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark
}
MouseArea {
Loader {
id: toolbar
anchors.fill: parent
onClicked: largeProgressBar._userHide = true
}
}
//-------------------------------------------------------------------------
//-- 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()
}
}
source: _mainToolbar
}
}
......@@ -472,7 +307,7 @@ ApplicationWindow {
//-------------------------------------------------------------------------
//-- 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 {
id: rootLoader
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>