Commit 63234180 authored by Lorenz Meier's avatar Lorenz Meier

Airframe QML: Fix order-dependency of config. Highlight selected airframe more...

Airframe QML: Fix order-dependency of config. Highlight selected airframe more clearly. Allow combo box action to select the airframe as well. Allow single click on icon to select airframe.
parent 32ec7228
...@@ -151,12 +151,18 @@ QGCView { ...@@ -151,12 +151,18 @@ QGCView {
// Outer summary item rectangle // Outer summary item rectangle
Rectangle { Rectangle {
id: airframeBackground
readonly property real titleHeight: 30 readonly property real titleHeight: 30
readonly property real innerMargin: 10 readonly property real innerMargin: 10
width: 250 width: 250
height: 200 height: 200
color: qgcPal.windowShade color: (modelData.name != controller.currentAirframeType) ? qgcPal.windowShade : qgcPal.buttonHighlight
MouseArea {
anchors.fill: parent
onClicked: airframeCheckBox.checked = true
}
Rectangle { Rectangle {
id: title id: title
...@@ -200,6 +206,9 @@ QGCView { ...@@ -200,6 +206,9 @@ QGCView {
onCheckedChanged: { onCheckedChanged: {
if (checked && combo.currentIndex != -1) { if (checked && combo.currentIndex != -1) {
controller.autostartId = modelData.airframes[combo.currentIndex].autostartId controller.autostartId = modelData.airframes[combo.currentIndex].autostartId
airframeBackground.color = qgcPal.buttonHighlight;
} else {
airframeBackground.color = qgcPal.windowShade;
} }
} }
} }
...@@ -214,10 +223,9 @@ QGCView { ...@@ -214,10 +223,9 @@ QGCView {
model: modelData.airframes model: modelData.airframes
currentIndex: (modelData.name == controller.currentAirframeType) ? controller.currentVehicleIndex : 0 currentIndex: (modelData.name == controller.currentAirframeType) ? controller.currentVehicleIndex : 0
onCurrentIndexChanged: { onActivated: {
if (airframeCheckBox.checked) { controller.autostartId = modelData.airframes[currentIndex].autostartId
controller.autostartId = modelData.airframes[currentIndex].autostartId airframeCheckBox.checked = true;
}
} }
} }
} }
......
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