From 75f419d6acf081379701ffab926588183707dc34 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sun, 11 Nov 2018 18:18:03 -0800 Subject: [PATCH] UI rework --- .../Common/RadioComponent.qml | 89 ++++++++++--------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/src/AutoPilotPlugins/Common/RadioComponent.qml b/src/AutoPilotPlugins/Common/RadioComponent.qml index c4f6b57ea..d37133f3d 100644 --- a/src/AutoPilotPlugins/Common/RadioComponent.qml +++ b/src/AutoPilotPlugins/Common/RadioComponent.qml @@ -7,10 +7,10 @@ * ****************************************************************************/ - import QtQuick 2.3 import QtQuick.Controls 1.2 import QtQuick.Dialogs 1.2 +import QtQuick.Layouts 1.11 import QGroundControl 1.0 import QGroundControl.FactSystem 1.0 @@ -348,9 +348,8 @@ SetupPage { } Connections { - target: controller - - onThrottleChannelRCValueChanged: throttleLoader.item.rcValue = rcValue + target: controller + onThrottleChannelRCValueChanged: throttleLoader.item.rcValue = rcValue } } } // Column - Attitude Control labels @@ -362,15 +361,13 @@ SetupPage { QGCButton { id: skipButton text: qsTr("Skip") - - onClicked: controller.skipButtonClicked() + onClicked: controller.skipButtonClicked() } QGCButton { id: cancelButton text: qsTr("Cancel") - - onClicked: controller.cancelButtonClicked() + onClicked: controller.cancelButtonClicked() } QGCButton { @@ -395,11 +392,6 @@ SetupPage { wrapMode: Text.WordWrap } - Item { - width: 10 - height: defaultTextHeight * 4 - } - Rectangle { width: parent.width height: 1 @@ -409,42 +401,50 @@ SetupPage { QGCLabel { text: qsTr("Additional Radio setup:") } - QGCButton { - id: bindButton - text: qsTr("Spektrum Bind") - - onClicked: showDialog(spektrumBindDialogComponent, dialogTitle, radioPage.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) - } + GridLayout { + id: switchSettingsGrid + anchors.left: parent.left + anchors.right: parent.right + columns: 2 + columnSpacing: ScreenTools.defaultFontPixelWidth - QGCButton { - text: qsTr("Copy Trims") - onClicked: showDialog(copyTrimsDialogComponent, dialogTitle, radioPage.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) - } + Repeater { + model: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware ? + (QGroundControl.multiVehicleManager.activeVehicle.multiRotor ? + [ "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_PARAM1", "RC_MAP_PARAM2", "RC_MAP_PARAM3"] : + [ "RC_MAP_FLAPS", "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_PARAM1", "RC_MAP_PARAM2", "RC_MAP_PARAM3"]) : + 0 - Repeater { - model: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware ? - (QGroundControl.multiVehicleManager.activeVehicle.multiRotor ? - [ "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_PARAM1", "RC_MAP_PARAM2", "RC_MAP_PARAM3"] : - [ "RC_MAP_FLAPS", "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_PARAM1", "RC_MAP_PARAM2", "RC_MAP_PARAM3"]) : - 0 + RowLayout { + Layout.fillWidth: true - Row { - spacing: ScreenTools.defaultFontPixelWidth - property Fact fact: controller.getParameterFact(-1, modelData) + property Fact fact: controller.getParameterFact(-1, modelData) - QGCLabel { - anchors.baseline: optCombo.baseline - text: fact.shortDescription + ":" + QGCLabel { + Layout.fillWidth: true + text: fact.shortDescription + } + FactComboBox { + width: ScreenTools.defaultFontPixelWidth * 15 + fact: parent.fact + indexModel: false + } } + } + } - FactComboBox { - id: optCombo - width: ScreenTools.defaultFontPixelWidth * 15 - fact: parent.fact - indexModel: false - } + RowLayout { + QGCButton { + id: bindButton + text: qsTr("Spektrum Bind") + onClicked: showDialog(spektrumBindDialogComponent, dialogTitle, radioPage.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) } - } // Repeater + + QGCButton { + text: qsTr("Copy Trims") + onClicked: showDialog(copyTrimsDialogComponent, dialogTitle, radioPage.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) + } + } } // Column - Left Column Item { @@ -458,7 +458,7 @@ SetupPage { id: rightColumn anchors.top: parent.top anchors.right: parent.right - width: Math.min(radioPage.defaultTextWidth * 35, availableWidth * 0.4) + width: ScreenTools.defaultFontPixelWidth * 40 spacing: ScreenTools.defaultFontPixelHeight / 2 Row { @@ -491,7 +491,8 @@ SetupPage { } RCChannelMonitor { - width: parent.width + width: parent.width + twoColumn: true } } // Column - Right Column } // Item -- 2.22.0