QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCCaptionCell.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6
7/// Card with an optional caption above its contents. Children are laid out in a column.
8Rectangle {
9 id: control
10
11 default property alias cellData: cellLayout.data
12 property alias caption: captionLabel.text
13
14 readonly property real _padding: ScreenTools.defaultFontPixelWidth * 1.5
15
16 implicitWidth: cellLayout.implicitWidth + _padding * 2
17 implicitHeight: cellLayout.implicitHeight + _padding * 2
18 color: qgcPal.windowCard
19 border.color: qgcPal.borderSubtle
20 radius: ScreenTools.defaultBorderRadius * 2
21
22 QGCPalette { id: qgcPal; colorGroupEnabled: control.enabled }
23
24 ColumnLayout {
25 id: cellLayout
26 anchors.fill: parent
27 anchors.margins: control._padding
28 spacing: ScreenTools.defaultFontPixelHeight * 0.25
29
30 QGCCaptionLabel {
31 id: captionLabel
32 visible: text !== ""
33 }
34 }
35}