VehicleSummary.qml 2.69 KB
Newer Older
1 2 3
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
4

5
import QGroundControl.FactSystem 1.0
6
import QGroundControl.Palette 1.0
7 8

Rectangle {
Don Gagne's avatar
Don Gagne committed
9 10 11
    width: 600
    height: 400

12
    property var qgcPal: QGCPalette { id: palette; colorGroupEnabled: true }
13

14 15 16
    id: topLevel
    objectName: "topLevel"

17
    color: qgcPal.window
18

19 20 21
    Flow {
        anchors.fill: parent
        spacing: 10
22

23 24
        Repeater {
            model: autopilot.components
25

26 27 28
            Button {
                width: 250
                height: 200
29

30 31 32
                property var summaryQmlSource: modelData.summaryQmlSource
                text: modelData.name
                property bool setupComplete: modelData.setupComplete
33

34 35 36 37 38
                style: ButtonStyle {
                    id: buttonStyle
                    background: Rectangle {
                        id: innerRect
                        readonly property real titleHeight: 30
39

40
                        color: qgcPal.windowShadeDark
41

42 43
                        Text {
                            id: titleBar
44

45 46
                            width: parent.width
                            height: parent.titleHeight
47

48 49
                            verticalAlignment: TextEdit.AlignVCenter
                            horizontalAlignment: TextEdit.AlignHCenter
50

51 52 53
                            text: control.text.toUpperCase()
                            color: qgcPal.buttonText
                            font.pixelSize: 12
54

55 56
                            Rectangle {
                                id: setupIndicator
57

58 59
                                property bool setupComplete: true
                                readonly property real indicatorRadius: 6
60

61 62 63 64
                                x: parent.width - (indicatorRadius * 2) - 5
                                y: (parent.height - (indicatorRadius * 2)) / 2
                                width: indicatorRadius * 2
                                height: indicatorRadius * 2
65

66 67
                                radius: indicatorRadius
                                color: control.setupComplete ? "#00d932" : "red"
68
                            }
69
                        }
70

71 72 73
                        Rectangle {
                            width: parent.width
                            height: parent.height - parent.titleHeight
74

75
                            y: parent.titleHeight
76

77
                            color: qgcPal.windowShade
78

79 80 81
                            Loader {
                                anchors.fill: parent
                                source: summaryQmlSource
82 83 84
                            }
                        }
                    }
85 86

                label: Item {}
87 88 89 90 91
                }
            }
        }
    }
}