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 QGCButton {
118 objectName: "toolbar_updateButton"
119 Layout.alignment: Qt.AlignHCenter
120 Layout.bottomMargin: ScreenTools.defaultFontPixelHeight / 2
121 implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
122 heightFactor: 0.2
123 leftPadding: ScreenTools.defaultFontPixelWidth
124 rightPadding: leftPadding
125 text: qsTr("Update")
126 primary: true
127 pointSize: ScreenTools.smallFontPointSize
128 visible: QGroundControl.newStableVersion !== ""
129 onClicked: {
130 mainWindow.closeIndicatorDrawer()
131 Qt.openUrlExternally(QGroundControl.corePlugin.stableDownloadUrl)
132 }
133 }
134
135 QGCLabel {
136 id: versionLabel
137 Layout.fillWidth: true
138 horizontalAlignment: Text.AlignHCenter
139 text: qsTr("%1 Version").arg(QGroundControl.appName)
140 font.pointSize: ScreenTools.smallFontPointSize
141 wrapMode: QGCLabel.WordWrap
142 }
143
144 QGCLabel {
145 Layout.fillWidth: true
146 horizontalAlignment: Text.AlignHCenter
147 text: QGroundControl.qgcVersion
148 font.pointSize: ScreenTools.smallFontPointSize
149 wrapMode: QGCLabel.WrapAnywhere
150 }
151
152 QGCLabel {
153 Layout.fillWidth: true
154 horizontalAlignment: Text.AlignHCenter
155 text: QGroundControl.qgcAppDate
156 font.pointSize: ScreenTools.smallFontPointSize
157 wrapMode: QGCLabel.WrapAnywhere
158 visible: QGroundControl.qgcDailyBuild
159
160 QGCMouseArea {
161 anchors.topMargin: -(parent.y - versionLabel.y)
162 anchors.fill: parent
163
164 onClicked: (mouse) => {
165 if (mouse.modifiers & Qt.ControlModifier) {
166 QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas
167 showTouchAreasNotification.open()
168 } else if (ScreenTools.isMobile || mouse.modifiers & Qt.ShiftModifier) {
169 mainWindow.closeIndicatorDrawer()
170 if (!QGroundControl.corePlugin.showAdvancedUI) {
171 advancedModeOnConfirmation.open()
172 } else {
173 advancedModeOffConfirmation.open()
174 }
175 }
176 }
177
178 // This allows you to change this on mobile
179 onPressAndHold: {
180 QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas
181 showTouchAreasNotification.open()
182 }
183 }
184 }
185 }
186 }
187 }
188}