From af054687eac80d5d2da7a23928f2e36965974358 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 20 Apr 2016 17:33:13 -0300 Subject: [PATCH] Clicking on the summary titles enter edit mode Clicking on the sumarry titles enters the edit mode On the tests with users, they always clicked on the title (because it resembled a button or something) and nothing happened. it was a bit confusing to have the same information in two places and only one of them being clickable. Signed-off-by: Tomaz Canabrava --- src/VehicleSetup/SetupView.qml | 8 ++++++++ src/VehicleSetup/VehicleSummary.qml | 16 ++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml index 18e50da45..d3f73a50b 100644 --- a/src/VehicleSetup/SetupView.qml +++ b/src/VehicleSetup/SetupView.qml @@ -38,6 +38,7 @@ import QGroundControl.MultiVehicleManager 1.0 Rectangle { color: qgcPal.window z: QGroundControl.zOrderTopMost + id: setupView QGCPalette { id: qgcPal; colorGroupEnabled: true } @@ -110,6 +111,13 @@ Rectangle { panelLoader.sourceComponent = messagePanelComponent } else { panelLoader.source = vehicleComponent.setupSource + for(var i = 0; i < componentRepeater.count; i++) { + var obj = componentRepeater.itemAt(i); + if (obj.text === vehicleComponent.name) { + obj.checked = true; + break; + } + } } } } diff --git a/src/VehicleSetup/VehicleSummary.qml b/src/VehicleSetup/VehicleSummary.qml index 18bf39b29..977370f63 100644 --- a/src/VehicleSetup/VehicleSummary.qml +++ b/src/VehicleSetup/VehicleSummary.qml @@ -117,19 +117,11 @@ Rectangle { readonly property real titleHeight: ScreenTools.defaultFontPixelHeight * 2 // Title bar - Rectangle { + QGCButton { id: titleBar width: parent.width height: titleHeight - color: qgcPal.windowShade - - // Title text - QGCLabel { - anchors.fill: parent - verticalAlignment: TextEdit.AlignVCenter - horizontalAlignment: TextEdit.AlignHCenter - text: capitalizeWords(modelData.name) - } + text: capitalizeWords(modelData.name) // Setup indicator Rectangle { @@ -142,6 +134,10 @@ Rectangle { color: modelData.setupComplete ? "#00d932" : "red" visible: modelData.requiresSetup } + + onClicked : { + setupView.showVehicleComponentPanel(modelData) + } } // Summary Qml -- 2.22.0