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 implicitHeight: root._toolButtonHeight
21 Layout.fillWidth: true
22 text: qsTr("Fly")
23 imageResource: "/res/FlyingPaperPlane.svg"
24 onClicked: {
25 if (mainWindow.allowViewSwitch()) {
26 mainWindow.closeIndicatorDrawer()
27 mainWindow.showFlyView()
28 }
29 }
30 }
31
32 SubMenuButton {
33 implicitHeight: root._toolButtonHeight
34 Layout.fillWidth: true
35 text: qsTr("Plan")
36 imageResource: "/qmlimages/Plan.svg"
37 onClicked: {
38 if (mainWindow.allowViewSwitch()) {
39 mainWindow.closeIndicatorDrawer()
40 mainWindow.showPlanView()
41 }
42 }
43 }
44
45 SubMenuButton {
46 implicitHeight: root._toolButtonHeight
47 Layout.fillWidth: true
48 text: qsTr("Analyze")
49 imageResource: "/qmlimages/Analyze.svg"
50 visible: QGroundControl.corePlugin.showAdvancedUI
51 onClicked: {
52 if (mainWindow.allowViewSwitch()) {
53 mainWindow.closeIndicatorDrawer()
54 mainWindow.showAnalyzeTool()
55 }
56 }
57 }
58
59 SubMenuButton {
60 id: setupButton
61 implicitHeight: root._toolButtonHeight
62 Layout.fillWidth: true
63 text: qsTr("Configure")
64 imageResource: "/res/GearWithPaperPlane.svg"
65 onClicked: {
66 if (mainWindow.allowViewSwitch()) {
67 mainWindow.closeIndicatorDrawer()
68 mainWindow.showVehicleConfig()
69 }
70 }
71 }
72
73 SubMenuButton {
74 id: settingsButton
75 implicitHeight: root._toolButtonHeight
76 Layout.fillWidth: true
77 text: qsTr("Settings")
78 imageResource: "/res/QGCLogoWhite.svg"
79 visible: !QGroundControl.corePlugin.options.combineSettingsAndSetup
80 onClicked: {
81 if (mainWindow.allowViewSwitch()) {
82 mainWindow.closeIndicatorDrawer()
83 mainWindow.showSettingsTool()
84 }
85 }
86 }
87
88 SubMenuButton {
89 id: closeButton
90 implicitHeight: root._toolButtonHeight
91 Layout.fillWidth: true
92 text: qsTr("Close")
93 imageResource: "/res/OpenDoor.svg"
94 onClicked: {
95 if (mainWindow.allowViewSwitch()) {
96 mainWindow.finishCloseProcess()
97 }
98 }
99 }
100
101 ColumnLayout {
102 id: versionColumnLayout
103 Layout.fillWidth: true
104 Layout.columnSpan: 2
105 spacing: 0
106
107 QGCLabel {
108 id: versionLabel
109 Layout.fillWidth: true
110 horizontalAlignment: Text.AlignHCenter
111 text: qsTr("%1 Version").arg(QGroundControl.appName)
112 font.pointSize: ScreenTools.smallFontPointSize
113 wrapMode: QGCLabel.WordWrap
114 }
115
116 QGCLabel {
117 Layout.fillWidth: true
118 horizontalAlignment: Text.AlignHCenter
119 text: QGroundControl.qgcVersion
120 font.pointSize: ScreenTools.smallFontPointSize
121 wrapMode: QGCLabel.WrapAnywhere
122 }
123
124 QGCLabel {
125 Layout.fillWidth: true
126 horizontalAlignment: Text.AlignHCenter
127 text: QGroundControl.qgcAppDate
128 font.pointSize: ScreenTools.smallFontPointSize
129 wrapMode: QGCLabel.WrapAnywhere
130 visible: QGroundControl.qgcDailyBuild
131
132 QGCMouseArea {
133 anchors.topMargin: -(parent.y - versionLabel.y)
134 anchors.fill: parent
135
136 onClicked: (mouse) => {
137 if (mouse.modifiers & Qt.ControlModifier) {
138 QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas
139 showTouchAreasNotification.open()
140 } else if (ScreenTools.isMobile || mouse.modifiers & Qt.ShiftModifier) {
141 mainWindow.closeIndicatorDrawer()
142 if (!QGroundControl.corePlugin.showAdvancedUI) {
143 advancedModeOnConfirmation.open()
144 } else {
145 advancedModeOffConfirmation.open()
146 }
147 }
148 }
149
150 // This allows you to change this on mobile
151 onPressAndHold: {
152 QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas
153 showTouchAreasNotification.open()
154 }
155 }
156 }
157 }
158 }
159 }
160}