Browse Source

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.

QGC4.4
Lorenz Meier 10 years ago
parent
commit
632341801b
  1. 16
      src/AutoPilotPlugins/PX4/AirframeComponent.qml

16
src/AutoPilotPlugins/PX4/AirframeComponent.qml

@ -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 {
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 {
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;
} }
} }
} }

Loading…
Cancel
Save