QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TelemetryValuesBar.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6
7Item {
8 id: control
9 implicitWidth: mainLayout.width + (_toolsMargin * 2)
10 implicitHeight: mainLayout.height + (_toolsMargin * 2)
11
12 property real extraWidth: 0 ///< Extra width to add to the background rectangle
13
14 property alias factValueGrid: factValueGrid
15 property alias settingsGroup: factValueGrid.settingsGroup
16 property alias specificVehicleForCard: factValueGrid.specificVehicleForCard
17
18 Rectangle {
19 id: backgroundRect
20 width: control.width + extraWidth
21 height: control.height
22 color: qgcPal.window
23 radius: ScreenTools.defaultFontPixelWidth / 2
24 opacity: 0.75
25 }
26
27 ColumnLayout {
28 id: mainLayout
29 anchors.margins: _toolsMargin
30 anchors.bottom: parent.bottom
31 anchors.left: parent.left
32
33 RowLayout {
34 visible: factValueGrid.settingsUnlocked
35
36 QGCColoredImage {
37 source: "qrc:/InstrumentValueIcons/lock-open.svg"
38 mipmap: true
39 width: ScreenTools.minTouchPixels * 0.75
40 height: width
41 sourceSize.width: width
42 color: qgcPal.text
43 fillMode: Image.PreserveAspectFit
44
45 QGCMouseArea {
46 anchors.fill: parent
47 onClicked: factValueGrid.settingsUnlocked = false
48 }
49 }
50 }
51
52 HorizontalFactValueGrid {
53 id: factValueGrid
54 }
55 }
56
57 QGCMouseArea {
58 id: mouseArea
59 x: mainLayout.x
60 y: mainLayout.y
61 width: mainLayout.width
62 height: mainLayout.height
63 acceptedButtons: Qt.LeftButton | Qt.RightButton
64 propagateComposedEvents: true
65 visible: !factValueGrid.settingsUnlocked
66
67 onClicked: (mouse) => {
68 if (!ScreenTools.isMobile && mouse.button === Qt.RightButton) {
69 factValueGrid.settingsUnlocked = true
70 mouse.accepted = true
71 }
72 }
73
74 onPressAndHold: (mouse) => {
75 factValueGrid.settingsUnlocked = true
76 mouse.accepted = true
77 }
78 }
79}