QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
AnalyzePage.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3
4import QGroundControl
5import QGroundControl.Controls
6
7/// Base view control for all Analyze pages
8Item {
9 anchors.fill: parent
10 anchors.margins: ScreenTools.defaultFontPixelWidth
11
12 property alias pageComponent: pageLoader.sourceComponent
13 property alias pageName: pageNameLabel.text
14 property alias pageDescription: pageDescriptionLabel.text
15 property alias headerComponent: headerLoader.sourceComponent
16 property real availableWidth: width - pageLoader.x
17 property real availableHeight: height - mainContent.y
18 property bool allowPopout: false
19 property bool popped: false
20 property real _margins: ScreenTools.defaultFontPixelHeight * 0.5
21
22 signal popout()
23
24 Loader {
25 id: headerLoader
26 anchors.topMargin: _margins
27 anchors.top: parent.top
28 anchors.left: parent.left
29 anchors.rightMargin: _margins
30 anchors.right: floatIcon.left
31 visible: !ScreenTools.isShortScreen && headerLoader.sourceComponent !== null
32 }
33
34 Column {
35 id: headingColumn
36 anchors.topMargin: _margins
37 anchors.top: parent.top
38 anchors.left: parent.left
39 anchors.rightMargin: _margins
40 anchors.right: floatIcon.visible ? floatIcon.left : parent.right
41 spacing: _margins
42 visible: !ScreenTools.isShortScreen && headerLoader.sourceComponent === null
43 QGCLabel {
44 id: pageNameLabel
45 font.pointSize: ScreenTools.largeFontPointSize
46 visible: !popped
47 }
48 QGCLabel {
49 id: pageDescriptionLabel
50 anchors.left: parent.left
51 anchors.right: parent.right
52 wrapMode: Text.WordWrap
53 }
54 }
55
56 Item {
57 id: mainContent
58 anchors.topMargin: ScreenTools.defaultFontPixelHeight
59 anchors.top: headerLoader.sourceComponent === null ? (headingColumn.visible ? headingColumn.bottom : parent.top) : headerLoader.bottom
60 anchors.bottom: parent.bottom
61 anchors.left: parent.left
62 anchors.right: parent.right
63 clip: true
64 Loader {
65 id: pageLoader
66 }
67 }
68
69 QGCColoredImage {
70 id: floatIcon
71 anchors.verticalCenter: headerLoader.visible ? headerLoader.verticalCenter : headingColumn.verticalCenter
72 anchors.right: parent.right
73 width: ScreenTools.defaultFontPixelHeight * 2
74 height: width
75 sourceSize.width: width
76 source: "/qmlimages/FloatingWindow.svg"
77 fillMode: Image.PreserveAspectFit
78 color: qgcPal.text
79 visible: allowPopout && !popped && !ScreenTools.isMobile
80 MouseArea {
81 anchors.fill: parent
82 onClicked: popout()
83 }
84 }
85}