diff --git a/src/AnalyzeView/AnalyzeView.qml b/src/AnalyzeView/AnalyzeView.qml index bf1fa8a2cdd6915ce02cba7582f931cb9565da6e..c81de6cf946fd20c8d4f063741daa590c1aac99b 100644 --- a/src/AnalyzeView/AnalyzeView.qml +++ b/src/AnalyzeView/AnalyzeView.qml @@ -82,15 +82,6 @@ Rectangle { } } - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - text: qsTr("Analyze") - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - visible: !ScreenTools.isShortScreen - } - Repeater { id: buttonRepeater model: QGroundControl.corePlugin ? QGroundControl.corePlugin.analyzePages : [] diff --git a/src/FlightDisplay/FlyViewToolStripActionList.qml b/src/FlightDisplay/FlyViewToolStripActionList.qml index 4f969d23a23a3e400a022b244fd119cffa2e5eab..451a482ce76b9e1fda614257b4da0a3d6b7436e6 100644 --- a/src/FlightDisplay/FlyViewToolStripActionList.qml +++ b/src/FlightDisplay/FlyViewToolStripActionList.qml @@ -18,6 +18,11 @@ ToolStripActionList { signal displayPreFlightChecklist model: [ + ToolStripAction { + text: qsTr("Plan") + iconSource: "/qmlimages/Plan.svg" + onTriggered: mainWindow.showPlanView() + }, PreFlightCheckListShowAction { onTriggered: displayPreFlightChecklist() }, GuidedActionTakeoff { }, GuidedActionLand { }, diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index bdc3fbd77cf497b0a1c4c9114e7358d2936797cc..620eb81fec5a24ce23962c04ffbfbf5cf468422d 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -624,14 +624,14 @@ Item { maxHeight: parent.height - toolStrip.y title: qsTr("Plan") - //readonly property int flyButtonIndex: 0 - readonly property int fileButtonIndex: 0 - readonly property int takeoffButtonIndex: 1 - readonly property int waypointButtonIndex: 2 - readonly property int roiButtonIndex: 3 - readonly property int patternButtonIndex: 4 - readonly property int landButtonIndex: 5 - readonly property int centerButtonIndex: 6 + readonly property int flyButtonIndex: 0 + readonly property int fileButtonIndex: 1 + readonly property int takeoffButtonIndex: 2 + readonly property int waypointButtonIndex: 3 + readonly property int roiButtonIndex: 4 + readonly property int patternButtonIndex: 5 + readonly property int landButtonIndex: 6 + readonly property int centerButtonIndex: 7 property bool _isRallyLayer: _editingLayer == _layerRallyPoints property bool _isMissionLayer: _editingLayer == _layerMission @@ -639,6 +639,11 @@ Item { ToolStripActionList { id: toolStripActionList model: [ + ToolStripAction { + text: qsTr("Fly") + iconSource: "/qmlimages/PaperPlane.svg" + onTriggered: mainWindow.showFlyView() + }, ToolStripAction { text: qsTr("File") enabled: !_planMasterController.syncInProgress diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml index 6ec84e3dd317833978cc83be02b05a3e57e75090..a8e3101b45aa1d2e1e612c45fab30296ab7faffb 100644 --- a/src/VehicleSetup/SetupView.qml +++ b/src/VehicleSetup/SetupView.qml @@ -205,14 +205,6 @@ Rectangle { id: buttonColumn spacing: _defaultTextHeight / 2 - QGCLabel { - Layout.fillWidth: true - text: qsTr("Vehicle Setup") - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - visible: !ScreenTools.isShortScreen - } - Repeater { model: _corePlugin ? _corePlugin.settingsPages : [] visible: _corePlugin && _corePlugin.options.combineSettingsAndSetup diff --git a/src/ui/AppSettings.qml b/src/ui/AppSettings.qml index 89d4674b0d2c16249ced488cfa863f87d8f826cb..a6e5ce6ca3c00efb47241d24024f0b51e3ee87e6 100644 --- a/src/ui/AppSettings.qml +++ b/src/ui/AppSettings.qml @@ -57,14 +57,6 @@ Rectangle { property real _maxButtonWidth: 0 - QGCLabel { - Layout.fillWidth: true - text: qsTr("Application Settings") - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - visible: !ScreenTools.isShortScreen - } - Repeater { model: QGroundControl.corePlugin.settingsPages QGCButton { diff --git a/src/ui/MainRootWindow.qml b/src/ui/MainRootWindow.qml index 1443be9dcfc2a4b9cdd3ebd73c873d0a22ee53d4..e8dfa4552eef1bea65ec7becc59e15737a164efa 100644 --- a/src/ui/MainRootWindow.qml +++ b/src/ui/MainRootWindow.qml @@ -124,11 +124,10 @@ ApplicationWindow { } function viewSwitch(currentToolbar) { - settingsWindow.visible = false - setupWindow.visible = false - analyzeWindow.visible = false + toolDrawer.visible = false + toolDrawer.source = "" flightView.visible = false - planViewLoader.visible = false + planView.visible = false toolbar.currentToolbar = currentToolbar } @@ -142,22 +141,25 @@ ApplicationWindow { function showPlanView() { viewSwitch(toolbar.planViewToolbar) - planViewLoader.visible = true + planView.visible = true } function showAnalyzeView() { - viewSwitch(toolbar.simpleToolbar) - analyzeWindow.visible = true + toolDrawer.source = "AnalyzeView.qml" + toolDrawer.title = qsTr("Analyze Tools") + toolDrawer.visible = true } function showSetupView() { - viewSwitch(toolbar.simpleToolbar) - setupWindow.visible = true + toolDrawer.source = "SetupView.qml" + toolDrawer.title = qsTr("Vehicle Setup") + toolDrawer.visible = true } function showSettingsView() { - viewSwitch(toolbar.simpleToolbar) - settingsWindow.visible = true + toolDrawer.source = "AppSettings.qml" + toolDrawer.title = qsTr("Application Settings") + toolDrawer.visible = true } //------------------------------------------------------------------------- @@ -326,11 +328,12 @@ ApplicationWindow { } Drawer { - id: viewSelectDrawer + id: toolSelectDrawer height: mainWindow.height edge: Qt.LeftEdge interactive: true dragMargin: 0 + closePolicy: Drawer.NoAutoClose visible: false property var _mainWindow: mainWindow @@ -357,74 +360,48 @@ ApplicationWindow { spacing: ScreenTools.defaultFontPixelWidth SubMenuButton { - id: flyButton - height: viewSelectDrawer._toolButtonHeight - Layout.fillWidth: true - text: qsTr("Fly View") - imageResource: "/qmlimages/PaperPlane.svg" - imageColor: qgcPal.text - onClicked: { - if (toolbar.viewButtonClicked(this)) { - mainWindow.showFlyView() - } - } - - } - - SubMenuButton { - id: planButton - height: viewSelectDrawer._toolButtonHeight + id: setupButton + height: toolSelectDrawer._toolButtonHeight Layout.fillWidth: true - text: qsTr("Plan Mission") - imageResource: "/qmlimages/Plan.svg" + text: qsTr("Vehicle Setup") imageColor: qgcPal.text + imageResource: "/qmlimages/Gears.svg" onClicked: { - if (toolbar.viewButtonClicked(this)) { - mainWindow.showPlanView() + if (!mainWindow.preventViewSwitch()) { + mainWindow.showSetupView() + toolSelectDrawer.visible = false } } } SubMenuButton { id: analyzeButton - height: viewSelectDrawer._toolButtonHeight + height: toolSelectDrawer._toolButtonHeight Layout.fillWidth: true text: qsTr("Analyze Tools") imageResource: "/qmlimages/Analyze.svg" imageColor: qgcPal.text visible: QGroundControl.corePlugin.showAdvancedUI onClicked: { - if (toolbar.viewButtonClicked(this)) { + if (!mainWindow.preventViewSwitch()) { mainWindow.showAnalyzeView() - } - } - } - - SubMenuButton { - id: setupButton - height: viewSelectDrawer._toolButtonHeight - Layout.fillWidth: true - text: qsTr("Vehicle Setup") - imageColor: qgcPal.text - imageResource: "/qmlimages/Gears.svg" - onClicked: { - if (toolbar.viewButtonClicked(this)) { - mainWindow.showSetupView() + toolSelectDrawer.visible = false } } } SubMenuButton { id: settingsButton - height: viewSelectDrawer._toolButtonHeight + height: toolSelectDrawer._toolButtonHeight Layout.fillWidth: true text: qsTr("Application Settings") imageResource: "/res/QGCLogoFull" imageColor: "transparent" visible: !QGroundControl.corePlugin.options.combineSettingsAndSetup onClicked: { - if (toolbar.viewButtonClicked(this)) { + if (!mainWindow.preventViewSwitch()) { mainWindow.showSettingsView() + toolSelectDrawer.visible = false } } } @@ -454,13 +431,18 @@ ApplicationWindow { } } + DeadMouseArea { + anchors.fill: easterEggMouseArea + } + QGCMouseArea { - anchors.fill: qgcVersionLayout + id: easterEggMouseArea + anchors.fill: qgcVersionLayout onClicked: { - if (mouse.modifiers & Qt.ShiftModifier) { + if (mouse.modifiers & Qt.ControlModifier) { QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas - } else { + } else if (mouse.modifiers & Qt.ShiftModifier) { if(!QGroundControl.corePlugin.showAdvancedUI) { advancedModeConfirmation.open() } else { @@ -483,47 +465,64 @@ ApplicationWindow { } } - //------------------------------------------------------------------------- - /// Fly View FlyView { id: flightView anchors.fill: parent } - //------------------------------------------------------------------------- - /// Plan View - Loader { - id: planViewLoader + PlanView { + id: planView anchors.fill: parent visible: false - source: "PlanView.qml" } - //------------------------------------------------------------------------- - /// Settings - Loader { - id: settingsWindow - anchors.fill: parent + Drawer { + id: toolDrawer + width: mainWindow.width + height: mainWindow.height + edge: Qt.LeftEdge + dragMargin: 0 visible: false - source: "AppSettings.qml" - } - //------------------------------------------------------------------------- - /// Setup - Loader { - id: setupWindow - anchors.fill: parent - visible: false - source: "SetupView.qml" - } + property alias title: toolbarDrawerText.text + property alias source: toolDrawerLoader.source - //------------------------------------------------------------------------- - /// Analyze - Loader { - id: analyzeWindow - anchors.fill: parent - visible: false - source: "AnalyzeView.qml" + Rectangle { + id: toolDrawerToolbar + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + height: ScreenTools.toolbarHeight + color: qgcPal.toolbarBackground + + QGCLabel { + id: toolbarDrawerText + anchors.margins: ScreenTools.defaultFontPixelWidth + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + font.pointSize: ScreenTools.largeFontPointSize + } + + QGCButton { + anchors.margins: ScreenTools.defaultFontPixelWidth + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Close") + enabled: !mainWindow.preventViewSwitch() + onClicked: { + toolDrawer.visible = false + toolDrawer.source = "" + } + } + } + + Loader { + id: toolDrawerLoader + anchors.left: parent.left + anchors.right: parent.right + anchors.top: toolDrawerToolbar.bottom + anchors.bottom: parent.bottom + } } //------------------------------------------------------------------------- diff --git a/src/ui/toolbar/MainToolBar.qml b/src/ui/toolbar/MainToolBar.qml index 6793faf27a71ef445620a385a3699e5e987752f3..454665800879f4560ffb62f0db6218f1d6923b29 100644 --- a/src/ui/toolbar/MainToolBar.qml +++ b/src/ui/toolbar/MainToolBar.qml @@ -33,28 +33,6 @@ Rectangle { property bool _communicationLost: _activeVehicle ? _activeVehicle.connectionLost : false property color _mainStatusBGColor: qgcPal.brandingPurple - Component.onCompleted: toolbar.viewButtonClicked(flyButton) - - function viewButtonClicked(button) { - if (mainWindow.preventViewSwitch()) { - return false - } - viewSelectDrawer.visible = false - currentButton.icon.source = button.imageResource - currentButton.logo = button.imageColor == "transparent" - return true - } - - //-- Setup can be invoked from c++ side - Connections { - target: setupWindow - onVisibleChanged: { - if (setupWindow.visible) { - toolbar.viewButtonClicked(setupButton) - } - } - } - QGCPalette { id: qgcPal } /// Bottom single pixel divider @@ -89,7 +67,9 @@ Rectangle { QGCToolBarButton { id: currentButton Layout.preferredHeight: viewButtonRow.height - onClicked: viewSelectDrawer.visible = true + icon.source: "/res/QGCLogoFull" + logo: true + onClicked: toolSelectDrawer.visible = true } MainStatusIndicator {