QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
AnalyzeView.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Window
3import QtQuick.Controls
4
5import QGroundControl
6import QGroundControl.Controls
7
8Rectangle {
9 id: _root
10 color: qgcPal.window
11 z: QGroundControl.zOrderTopMost
12
13 signal popout()
14
15 readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight
16 readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth
17 readonly property real _horizontalMargin: _defaultTextWidth / 2
18 readonly property real _verticalMargin: _defaultTextHeight / 2
19 readonly property real _buttonWidth: _defaultTextWidth * 18
20
21 // This need to block click event leakage to underlying map.
22 DeadMouseArea {
23 anchors.fill: parent
24 }
25
26 GeoTagController {
27 id: geoController
28 }
29
30 QGCFlickable {
31 id: buttonScroll
32 width: buttonColumn.width
33 anchors.topMargin: _defaultTextHeight / 2
34 anchors.top: parent.top
35 anchors.bottom: parent.bottom
36 anchors.leftMargin: _horizontalMargin
37 anchors.left: parent.left
38 contentHeight: buttonColumn.height
39 flickableDirection: Flickable.VerticalFlick
40 clip: true
41
42 Column {
43 id: buttonColumn
44 width: _maxButtonWidth
45 spacing: _defaultTextHeight / 2
46
47 property real _maxButtonWidth: 0
48
49 Component.onCompleted: reflowWidths()
50
51 // I don't know why this does not work
52 Connections {
53 target: QGroundControl.settingsManager.appSettings.appFontPointSize
54 function onValueChanged(value) { buttonColumn.reflowWidths() }
55 }
56
57 function reflowWidths() {
58 buttonColumn._maxButtonWidth = 0
59 for (var i = 0; i < children.length; i++) {
60 buttonColumn._maxButtonWidth = Math.max(buttonColumn._maxButtonWidth, children[i].width)
61 }
62 for (var j = 0; j < children.length; j++) {
63 children[j].width = buttonColumn._maxButtonWidth
64 }
65 }
66
67 Repeater {
68 id: buttonRepeater
69 model: QGroundControl.corePlugin ? QGroundControl.corePlugin.analyzePages : []
70
71 Component.onCompleted: itemAt(0).checked = true
72
73 SubMenuButton {
74 id: subMenu
75 imageResource: modelData.icon
76 autoExclusive: true
77 text: modelData.title
78
79 onClicked: {
80 panelLoader.source = modelData.url
81 panelLoader.title = modelData.title
82 checked = true
83 }
84 }
85 }
86 }
87 }
88
89 Rectangle {
90 id: divider
91 anchors.topMargin: _verticalMargin
92 anchors.bottomMargin: _verticalMargin
93 anchors.leftMargin: _horizontalMargin
94 anchors.left: buttonScroll.right
95 anchors.top: parent.top
96 anchors.bottom: parent.bottom
97 width: 1
98 color: qgcPal.windowShade
99 }
100
101 Loader {
102 id: panelLoader
103 anchors.topMargin: _verticalMargin
104 anchors.bottomMargin: _verticalMargin
105 anchors.leftMargin: _horizontalMargin
106 anchors.rightMargin: _horizontalMargin
107 anchors.left: divider.right
108 anchors.right: parent.right
109 anchors.top: parent.top
110 anchors.bottom: parent.bottom
111 source: "LogDownloadPage.qml"
112
113 property string title
114
115 Connections {
116 target: panelLoader.item
117 function onPopout() { mainWindow.createrWindowedAnalyzePage(panelLoader.title, panelLoader.source) }
118 }
119 }
120}