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 pageDescription: pageDescriptionLabel.text
14 property alias headerComponent: headerLoader.sourceComponent
15 property real availableWidth: width - pageLoader.x
16 property real availableHeight: height - mainContent.y
17 property bool allowPopout: false
18 property bool popped: false
19 property real _margins: ScreenTools.defaultFontPixelHeight * 0.5
20
21 signal popout()
22
23 Loader {
24 id: headerLoader
25 anchors.topMargin: _margins
26 anchors.top: parent.top
27 anchors.left: parent.left
28 anchors.rightMargin: _margins
29 anchors.right: floatIcon.left
30 visible: !ScreenTools.isShortScreen && headerLoader.sourceComponent !== null
31 }
32
33 Column {
34 id: headingColumn
35 anchors.topMargin: _margins
36 anchors.top: parent.top
37 anchors.left: parent.left
38 anchors.rightMargin: _margins
39 anchors.right: floatIcon.visible ? floatIcon.left : parent.right
40 spacing: _margins
41 visible: !ScreenTools.isShortScreen && headerLoader.sourceComponent === null
42 QGCLabel {
43 id: pageDescriptionLabel
44 anchors.left: parent.left
45 anchors.right: parent.right
46 wrapMode: Text.WordWrap
47 }
48 }
49
50 Item {
51 id: mainContent
52 anchors.topMargin: ScreenTools.defaultFontPixelHeight
53 anchors.top: headerLoader.sourceComponent === null ? (headingColumn.visible ? headingColumn.bottom : parent.top) : headerLoader.bottom
54 anchors.bottom: parent.bottom
55 anchors.left: parent.left
56 anchors.right: parent.right
57 clip: true
58 Loader {
59 id: pageLoader
60 }
61 }
62
63 QGCColoredImage {
64 id: floatIcon
65 anchors.verticalCenter: headerLoader.visible ? headerLoader.verticalCenter : headingColumn.verticalCenter
66 anchors.right: parent.right
67 width: ScreenTools.defaultFontPixelHeight * 2
68 height: width
69 sourceSize.width: width
70 source: "/qmlimages/FloatingWindow.svg"
71 fillMode: Image.PreserveAspectFit
72 color: qgcPal.text
73 visible: allowPopout && !popped && !ScreenTools.isMobile
74 QGCMouseArea {
75 fillItem: floatIcon
76 onClicked: popout()
77 }
78 }
79}