From 632341801bfa5d066902edba76c1c2d29812f349 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 4 Aug 2015 12:47:39 +0200 Subject: [PATCH] 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. --- src/AutoPilotPlugins/PX4/AirframeComponent.qml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/AutoPilotPlugins/PX4/AirframeComponent.qml b/src/AutoPilotPlugins/PX4/AirframeComponent.qml index 43ff21671..2d1600e24 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponent.qml +++ b/src/AutoPilotPlugins/PX4/AirframeComponent.qml @@ -151,12 +151,18 @@ QGCView { // Outer summary item rectangle Rectangle { + id: airframeBackground readonly property real titleHeight: 30 readonly property real innerMargin: 10 width: 250 height: 200 - color: qgcPal.windowShade + color: (modelData.name != controller.currentAirframeType) ? qgcPal.windowShade : qgcPal.buttonHighlight + + MouseArea { + anchors.fill: parent + onClicked: airframeCheckBox.checked = true + } Rectangle { id: title @@ -200,6 +206,9 @@ QGCView { onCheckedChanged: { if (checked && combo.currentIndex != -1) { controller.autostartId = modelData.airframes[combo.currentIndex].autostartId + airframeBackground.color = qgcPal.buttonHighlight; + } else { + airframeBackground.color = qgcPal.windowShade; } } } @@ -214,10 +223,9 @@ QGCView { model: modelData.airframes currentIndex: (modelData.name == controller.currentAirframeType) ? controller.currentVehicleIndex : 0 - onCurrentIndexChanged: { - if (airframeCheckBox.checked) { - controller.autostartId = modelData.airframes[currentIndex].autostartId - } + onActivated: { + controller.autostartId = modelData.airframes[currentIndex].autostartId + airframeCheckBox.checked = true; } } } -- 2.22.0