QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VehicleSummaryTile.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6
7/// One required component in the setup checklist on the Summary page. Opens the component's setup page when clicked.
8Rectangle {
9 id: control
10
11 property string text
12 property bool done: false
13 property bool next: false
14 property bool clickable: true
15
16 signal clicked()
17
18 Layout.fillWidth: true
19 implicitHeight: rowLayout.implicitHeight + ScreenTools.defaultFontPixelWidth * 2
20 radius: ScreenTools.defaultBorderRadius
21 color: next ? qgcPal.accentSubtle : qgcPal.windowCard
22 border.color: done ? qgcPal.colorGreen : (next || (clickable && mouseArea.containsMouse)) ? qgcPal.accent : qgcPal.borderSubtle
23
24 QGCPalette { id: qgcPal }
25
26 MouseArea {
27 id: mouseArea
28 anchors.fill: parent
29 hoverEnabled: true
30 cursorShape: control.clickable ? Qt.PointingHandCursor : Qt.ArrowCursor
31 onClicked: {
32 if (control.clickable) {
33 control.clicked()
34 }
35 }
36 }
37
38 RowLayout {
39 id: rowLayout
40 anchors.fill: parent
41 anchors.margins: ScreenTools.defaultFontPixelWidth
42 spacing: ScreenTools.defaultFontPixelWidth
43
44 VehicleSummaryLabel {
45 Layout.fillWidth: true
46 text: control.text
47 font.bold: true
48 elide: Text.ElideRight
49 }
50
51 VehicleSummaryLabel {
52 text: control.done ? qsTr("Done") : control.next ? qsTr("Next") : qsTr("To do")
53 font.pointSize: ScreenTools.smallFontPointSize
54 font.bold: control.done || control.next
55 color: control.done ? qgcPal.successText : control.next ? qgcPal.accent : qgcPal.textSecondary
56 }
57
58 Rectangle {
59 implicitWidth: ScreenTools.defaultFontPixelHeight * 1.1
60 implicitHeight: implicitWidth
61 radius: implicitWidth / 2
62 color: control.done ? qgcPal.colorGreen : "transparent"
63 border.color: control.done ? qgcPal.colorGreen : control.next ? qgcPal.accent : qgcPal.borderSubtle
64 border.width: control.next ? 2 : 1
65
66 VehicleSummaryLabel {
67 anchors.centerIn: parent
68 text: "✓"
69 font.pointSize: ScreenTools.smallFontPointSize
70 font.bold: true
71 color: qgcPal.window
72 visible: control.done
73 }
74 }
75 }
76}