Browse Source

Change Tool Drawer to Dialog

QGC4.4
DonLakeFlyer 4 years ago committed by Don Gagne
parent
commit
8cc9037088
  1. 77
      src/ui/MainRootWindow.qml
  2. 2
      src/ui/toolbar/MainToolBar.qml

77
src/ui/MainRootWindow.qml

@ -329,55 +329,50 @@ ApplicationWindow { @@ -329,55 +329,50 @@ ApplicationWindow {
visible: QGroundControl.settingsManager.flyViewSettings.showLogReplayStatusBar.rawValue
}
Drawer {
id: toolSelectDrawer
height: mainWindow.height
edge: Qt.LeftEdge
interactive: true
dragMargin: 0
visible: false
function showToolSelectDialog() {
if (!mainWindow.preventViewSwitch()) {
showPopupDialogFromComponent(toolSelectDialogComponent)
}
}
property var _mainWindow: mainWindow
property real _toolButtonHeight: ScreenTools.defaultFontPixelHeight * 3
Component {
id: toolSelectDialogComponent
Rectangle {
width: mainLayout.width + (mainLayout.anchors.margins * 2)
height: parent.height
color: qgcPal.window
QGCPopupDialog {
id: toolSelectDialog
title: qsTr("Select Tool")
buttons: StandardButton.Close
QGCFlickable {
anchors.top: parent.top
anchors.bottom: qgcVersionLayout.top
anchors.left: parent.left
anchors.right: parent.right
contentHeight: mainLayout.height + (mainLayout.anchors.margins * 2)
flickableDirection: QGCFlickable.VerticalFlick
property real _toolButtonHeight: ScreenTools.defaultFontPixelHeight * 3
property real _margins: ScreenTools.defaultFontPixelWidth
ColumnLayout {
id: mainLayout
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.top: parent.top
width: innerLayout.width + (_margins * 2)
height: innerLayout.height + (_margins * 2)
ColumnLayout {
id: innerLayout
Layout.margins: _margins
spacing: ScreenTools.defaultFontPixelWidth
SubMenuButton {
id: setupButton
height: toolSelectDrawer._toolButtonHeight
height: _toolButtonHeight
Layout.fillWidth: true
text: qsTr("Vehicle Setup")
imageColor: qgcPal.text
imageResource: "/qmlimages/Gears.svg"
onClicked: {
if (!mainWindow.preventViewSwitch()) {
toolSelectDialog.hideDialog()
mainWindow.showSetupTool()
toolSelectDrawer.visible = false
}
}
}
SubMenuButton {
id: analyzeButton
height: toolSelectDrawer._toolButtonHeight
height: _toolButtonHeight
Layout.fillWidth: true
text: qsTr("Analyze Tools")
imageResource: "/qmlimages/Analyze.svg"
@ -385,15 +380,15 @@ ApplicationWindow { @@ -385,15 +380,15 @@ ApplicationWindow {
visible: QGroundControl.corePlugin.showAdvancedUI
onClicked: {
if (!mainWindow.preventViewSwitch()) {
toolSelectDialog.hideDialog()
mainWindow.showAnalyzeTool()
toolSelectDrawer.visible = false
}
}
}
SubMenuButton {
id: settingsButton
height: toolSelectDrawer._toolButtonHeight
height: _toolButtonHeight
Layout.fillWidth: true
text: qsTr("Application Settings")
imageResource: "/res/QGCLogoFull"
@ -401,44 +396,36 @@ ApplicationWindow { @@ -401,44 +396,36 @@ ApplicationWindow {
visible: !QGroundControl.corePlugin.options.combineSettingsAndSetup
onClicked: {
if (!mainWindow.preventViewSwitch()) {
toolSelectDialog.hideDialog()
mainWindow.showSettingsTool()
toolSelectDrawer.visible = false
}
}
}
}
}
ColumnLayout {
id: qgcVersionLayout
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
width: innerLayout.width
spacing: 0
QGCLabel {
id: versionLabel
text: qsTr("%1 Version").arg(QGroundControl.appName)
font.pointSize: ScreenTools.smallFontPointSize
wrapMode: QGCLabel.WordWrap
Layout.maximumWidth: parent.width
Layout.alignment: Qt.AlignHCenter
}
QGCLabel {
text: QGroundControl.qgcVersion
font.pointSize: ScreenTools.smallFontPointSize
wrapMode: QGCLabel.WrapAnywhere
Layout.maximumWidth: parent.width
Layout.alignment: Qt.AlignHCenter
}
}
DeadMouseArea {
anchors.fill: easterEggMouseArea
}
QGCMouseArea {
id: easterEggMouseArea
anchors.fill: qgcVersionLayout
anchors.topMargin: -versionLabel.height
anchors.fill: parent
onClicked: {
if (mouse.modifiers & Qt.ControlModifier) {
@ -465,6 +452,10 @@ ApplicationWindow { @@ -465,6 +452,10 @@ ApplicationWindow {
}
}
}
}
}
}
}
FlyView {
id: flightView

2
src/ui/toolbar/MainToolBar.qml

@ -69,7 +69,7 @@ Rectangle { @@ -69,7 +69,7 @@ Rectangle {
Layout.preferredHeight: viewButtonRow.height
icon.source: "/res/QGCLogoFull"
logo: true
onClicked: toolSelectDrawer.visible = true
onClicked: mainWindow.showToolSelectDialog()
}
MainStatusIndicator {

Loading…
Cancel
Save