QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PlanInspectorHeader.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6
7/// Inspector header: back and step buttons when drilled in, delete, and the title of the inspected element
8ColumnLayout {
9 id: root
10
11 property string namePrefix ///< Prefix of the objectNames of the header controls
12 property string title
13 property string subtitle
14 property bool drillIn: false ///< true: show the back and previous/next buttons
15 property bool canStepPrevious: false
16 property bool canStepNext: false
17 property bool deletable: true
18
19 signal backRequested
20 signal previousRequested
21 signal nextRequested
22 signal deleteRequested
23
24 spacing: ScreenTools.defaultFontPixelHeight * 0.4
25
26 QGCPalette { id: qgcPal }
27
28 RowLayout {
29 Layout.fillWidth: true
30 spacing: ScreenTools.defaultFontPixelWidth / 2
31
32 PlanPanelIconButton {
33 objectName: root.namePrefix + "_back"
34 accessibleName: qsTr("Back")
35 iconSource: "/InstrumentValueIcons/cheveron-right.svg"
36 iconRotation: 180
37 visible: root.drillIn
38 onClicked: root.backRequested()
39 }
40
41 QGCLabel {
42 Layout.fillWidth: true
43 text: root.subtitle
44 color: qgcPal.textSecondary
45 }
46
47 PlanPanelIconButton {
48 objectName: root.namePrefix + "_previous"
49 accessibleName: qsTr("Previous")
50 iconSource: "/InstrumentValueIcons/cheveron-right.svg"
51 iconRotation: -90
52 visible: root.drillIn
53 enabled: root.canStepPrevious
54 onClicked: root.previousRequested()
55 }
56
57 PlanPanelIconButton {
58 objectName: root.namePrefix + "_next"
59 accessibleName: qsTr("Next")
60 iconSource: "/InstrumentValueIcons/cheveron-right.svg"
61 iconRotation: 90
62 visible: root.drillIn
63 enabled: root.canStepNext
64 onClicked: root.nextRequested()
65 }
66
67 PlanPanelIconButton {
68 objectName: root.namePrefix + "_delete"
69 accessibleName: qsTr("Delete")
70 iconSource: "/res/TrashDelete.svg"
71 danger: true
72 visible: root.deletable
73 onClicked: root.deleteRequested()
74 }
75 }
76
77 QGCLabel {
78 objectName: root.namePrefix + "_title"
79 Layout.fillWidth: true
80 text: root.title
81 font.bold: true
82 font.capitalization: Font.AllUppercase
83 font.letterSpacing: ScreenTools.defaultFontPixelWidth * 0.1
84 elide: Text.ElideRight
85 }
86}