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_viewAnalyze"
49 implicitHeight: root._toolButtonHeight
50 Layout.fillWidth: true
51 text: qsTr("Analyze")
52 imageResource: "/qmlimages/Analyze.svg"
53 visible: QGroundControl.corePlugin.showAdvancedUI
54 onClicked: {
55 if (mainWindow.allowViewSwitch()) {
56 mainWindow.closeIndicatorDrawer()
57 mainWindow.showAnalyzeTool()
58 }
59 }
60 }
61
62 SubMenuButton {
63 id: setupButton
64 objectName: "toolbar_viewConfigure"
65 implicitHeight: root._toolButtonHeight
66 Layout.fillWidth: true
67 text: qsTr("Configure")
68 imageResource: "/res/GearWithPaperPlane.svg"
69 onClicked: {
70 if (mainWindow.allowViewSwitch()) {
71 mainWindow.closeIndicatorDrawer()
72 mainWindow.showVehicleConfig()
73 }
74 }
75 }
76
77 SubMenuButton {
78 id: settingsButton
79 objectName: "toolbar_viewSettings"
80 implicitHeight: root._toolButtonHeight
81 Layout.fillWidth: true
82 text: qsTr("Settings")
83 imageResource: "/res/QGCLogoWhite.svg"
84 visible: !QGroundControl.corePlugin.options.combineSettingsAndSetup
85 onClicked: {
86 if (mainWindow.allowViewSwitch()) {
87 mainWindow.closeIndicatorDrawer()
88 mainWindow.showSettingsTool()
89 }
90 }
91 }
92
93 SubMenuButton {
94 id: closeButton
95 objectName: "toolbar_viewClose"
96 implicitHeight: root._toolButtonHeight
97 Layout.fillWidth: true
98 text: qsTr("Close")
99 imageResource: "/res/OpenDoor.svg"
100 onClicked: {
101 if (mainWindow.allowViewSwitch()) {
102 mainWindow.closeIndicatorDrawer()
103 // Route through the window close handler so the unsaved
104 // mission / pending parameter / active connection checks
105 // run, matching the desktop window-close behavior.
106 mainWindow.close()
107 }
108 }
109 }
110
111 ColumnLayout {
112 id: versionColumnLayout
113 Layout.fillWidth: true
114 Layout.columnSpan: 2
115 spacing: 0
116
117 QGCLabel {
118 id: versionLabel
119 Layout.fillWidth: true
120 horizontalAlignment: Text.AlignHCenter
121 text: qsTr("%1 Version").arg(QGroundControl.appName)
122 font.pointSize: ScreenTools.smallFontPointSize
123 wrapMode: QGCLabel.WordWrap
124 }
125
126 QGCLabel {
127 Layout.fillWidth: true
128 horizontalAlignment: Text.AlignHCenter
129 text: QGroundControl.qgcVersion
130 font.pointSize: ScreenTools.smallFontPointSize
131 wrapMode: QGCLabel.WrapAnywhere
132 }
133
134 QGCLabel {
135 Layout.fillWidth: true
136 horizontalAlignment: Text.AlignHCenter
137 text: QGroundControl.qgcAppDate
138 font.pointSize: ScreenTools.smallFontPointSize
139 wrapMode: QGCLabel.WrapAnywhere
140 visible: QGroundControl.qgcDailyBuild
141
142 QGCMouseArea {
143 anchors.topMargin: -(parent.y - versionLabel.y)
144 anchors.fill: parent
145
146 onClicked: (mouse) => {
147 if (mouse.modifiers & Qt.ControlModifier) {
148 QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas
149 showTouchAreasNotification.open()
150 } else if (ScreenTools.isMobile || mouse.modifiers & Qt.ShiftModifier) {
151 mainWindow.closeIndicatorDrawer()
152 if (!QGroundControl.corePlugin.showAdvancedUI) {
153 advancedModeOnConfirmation.open()
154 } else {
155 advancedModeOffConfirmation.open()
156 }
157 }
158 }
159
160 // This allows you to change this on mobile
161 onPressAndHold: {
162 QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas
163 showTouchAreasNotification.open()
164 }
165 }
166 }
167 }
168 }
169 }
170}