Commit 1e5929ce authored by Don Gagne's avatar Don Gagne

Cleanup Vehicle Summary Qml

No longer buttons so switch to Rectangle for cleaner Qml
parent 2a4c779d
......@@ -4,6 +4,7 @@ import QtQuick.Controls.Styles 1.2
import QGroundControl.FactSystem 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
Rectangle {
width: 600
......@@ -16,75 +17,81 @@ Rectangle {
color: qgcPal.window
Flow {
Column {
anchors.fill: parent
QGCLabel {
text: "VEHICLE SUMMARY"
font.pointSize: 20
}
Item {
// Just used as a spacer
height: 20
width: 10
}
Flow {
width: parent.width
spacing: 10
Repeater {
model: autopilot.components
Button {
// Outer summary item rectangle
Rectangle {
readonly property real titleHeight: 30
width: 250
height: 200
color: qgcPal.windowShade
property var summaryQmlSource: modelData.summaryQmlSource
text: modelData.name
property bool setupComplete: modelData.setupComplete
style: ButtonStyle {
id: buttonStyle
background: Rectangle {
id: innerRect
readonly property real titleHeight: 30
// Title bar
Rectangle {
width: parent.width
height: titleHeight
color: qgcPal.windowShadeDark
// Title text
Text {
id: titleBar
anchors.fill: parent
width: parent.width
height: parent.titleHeight
color: qgcPal.buttonText
font.pixelSize: 12
text: modelData.name.toUpperCase()
verticalAlignment: TextEdit.AlignVCenter
horizontalAlignment: TextEdit.AlignHCenter
}
}
text: control.text.toUpperCase()
color: qgcPal.buttonText
font.pixelSize: 12
// Setup indicator
Rectangle {
id: setupIndicator
property bool setupComplete: true
readonly property real indicatorRadius: 6
readonly property real indicatorRightInset: 5
x: parent.width - (indicatorRadius * 2) - 5
y: (parent.height - (indicatorRadius * 2)) / 2
x: parent.width - (indicatorRadius * 2) - indicatorRightInset
y: (parent.titleHeight - (indicatorRadius * 2)) / 2
width: indicatorRadius * 2
height: indicatorRadius * 2
radius: indicatorRadius
color: control.setupComplete ? "#00d932" : "red"
}
color: modelData.setupComplete ? "#00d932" : "red"
}
// Summary Qml
Rectangle {
y: parent.titleHeight
width: parent.width
height: parent.height - parent.titleHeight
y: parent.titleHeight
color: qgcPal.windowShade
Loader {
anchors.fill: parent
source: summaryQmlSource
source: modelData.summaryQmlSource
}
}
}
label: Item {}
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment