QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
SelectViewDropdown.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.Controls
7
8ToolIndicatorPage {
9 id: root
10
11 property real _toolButtonHeight: ScreenTools.defaultFontPixelHeight * 3
12
13 contentComponent: Component {
14 GridLayout {
15 columns: 2
16 columnSpacing: ScreenTools.defaultFontPixelWidth
17 rowSpacing: columnSpacing
18
19 SubMenuButton {
20 objectName: "toolbar_viewFly"
21 implicitHeight: root._toolButtonHeight
22 Layout.fillWidth: true
23 text: qsTr("Fly")
24 imageResource: "/res/FlyingPaperPlane.svg"
25 onClicked: {
26 if (mainWindow.allowViewSwitch()) {
27 mainWindow.closeIndicatorDrawer()
28 mainWindow.showFlyView()
29 }
30 }
31 }
32
33 SubMenuButton {
34 objectName: "toolbar_viewPlan"
35 implicitHeight: root._toolButtonHeight
36 Layout.fillWidth: true
37 text: qsTr("Plan")
38 imageResource: "/qmlimages/Plan.svg"
39 onClicked: {
40 if (mainWindow.allowViewSwitch()) {
41 mainWindow.closeIndicatorDrawer()
42 mainWindow.showPlanView()
43 }
44 }
45 }
46
47 SubMenuButton {
48 objectName: "toolbar_viewGeo"
49 implicitHeight: root._toolButtonHeight
50 Layout.fillWidth: true
51 text: qsTr("GeoView")
52 imageResource: "/InstrumentValueIcons/globe.svg"
53 visible: QGroundControl.settingsManager.geoViewSettings.enabled.rawValue
54 onClicked: {
55 if (mainWindow.allowViewSwitch()) {
56 mainWindow.closeIndicatorDrawer()
57 mainWindow.showGeoView()
58 }
59 }
60 }
61
62 SubMenuButton {
63 objectName: "toolbar_viewAnalyze"
64 implicitHeight: root._toolButtonHeight
65 Layout.fillWidth: true
66 text: qsTr("Analyze")
67 imageResource: "/qmlimages/Analyze.svg"
68 visible: QGroundControl.corePlugin.showAdvancedUI
69 onClicked: {
70 if (mainWindow.allowViewSwitch()) {
71 mainWindow.closeIndicatorDrawer()
72 mainWindow.showAnalyzeTool()
73 }
74 }
75 }
76
77 SubMenuButton {
78 id: setupButton
79 objectName: "toolbar_viewConfigure"
80 implicitHeight: root._toolButtonHeight
81 Layout.fillWidth: true
82 text: qsTr("Configure")
83 imageResource: "/res/GearWithPaperPlane.svg"
84 onClicked: {
85 if (mainWindow.allowViewSwitch()) {
86 mainWindow.closeIndicatorDrawer()
87 mainWindow.showVehicleConfig()
88 }
89 }
90 }
91
92 SubMenuButton {
93 id: settingsButton
94 objectName: "toolbar_viewSettings"
95 implicitHeight: root._toolButtonHeight
96 Layout.fillWidth: true
97 text: qsTr("Settings")
98 imageResource: "/res/QGCLogoWhite.svg"
99 visible: !QGroundControl.corePlugin.options.combineSettingsAndSetup
100 onClicked: {
101 if (mainWindow.allowViewSwitch()) {
102 mainWindow.closeIndicatorDrawer()
103 mainWindow.showSettingsTool()
104 }
105 }
106 }
107
108 SubMenuButton {
109 id: closeButton
110 objectName: "toolbar_viewClose"
111 implicitHeight: root._toolButtonHeight
112 Layout.fillWidth: true
113 text: qsTr("Close")
114 imageResource: "/res/OpenDoor.svg"
115 onClicked: {
116 if (mainWindow.allowViewSwitch()) {
117 mainWindow.closeIndicatorDrawer()
118 // Route through the window close handler so the unsaved
119 // mission / pending parameter / active connection checks
120 // run, matching the desktop window-close behavior.
121 mainWindow.close()
122 }
123 }
124 }
125
126 ColumnLayout {
127 id: versionColumnLayout
128 Layout.fillWidth: true
129 Layout.columnSpan: 2
130 spacing: 0
131
132 QGCLabel {
133 id: versionLabel
134 Layout.fillWidth: true
135 horizontalAlignment: Text.AlignHCenter
136 text: qsTr("%1 Version").arg(QGroundControl.appName)
137 font.pointSize: ScreenTools.smallFontPointSize
138 wrapMode: QGCLabel.WordWrap
139 }
140
141 QGCLabel {
142 Layout.fillWidth: true
143 horizontalAlignment: Text.AlignHCenter
144 text: QGroundControl.qgcVersion
145 font.pointSize: ScreenTools.smallFontPointSize
146 wrapMode: QGCLabel.WrapAnywhere
147 }
148
149 QGCLabel {
150 Layout.fillWidth: true
151 horizontalAlignment: Text.AlignHCenter
152 text: QGroundControl.qgcAppDate
153 font.pointSize: ScreenTools.smallFontPointSize
154 wrapMode: QGCLabel.WrapAnywhere
155 visible: QGroundControl.qgcDailyBuild
156
157 QGCMouseArea {
158 anchors.topMargin: -(parent.y - versionLabel.y)
159 anchors.fill: parent
160
161 onClicked: (mouse) => {
162 if (mouse.modifiers & Qt.ControlModifier) {
163 QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas
164 showTouchAreasNotification.open()
165 } else if (ScreenTools.isMobile || mouse.modifiers & Qt.ShiftModifier) {
166 mainWindow.closeIndicatorDrawer()
167 if (!QGroundControl.corePlugin.showAdvancedUI) {
168 advancedModeOnConfirmation.open()
169 } else {
170 advancedModeOffConfirmation.open()
171 }
172 }
173 }
174
175 // This allows you to change this on mobile
176 onPressAndHold: {
177 QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas
178 showTouchAreasNotification.open()
179 }
180 }
181 }
182 }
183 }
184 }
185}