From 8663920e23e9080dfe81ceab5d6bc8526fd028bd Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Wed, 12 Apr 2017 12:51:21 -0700 Subject: [PATCH] Better visual layout --- src/PlanView/SimpleItemEditor.qml | 59 +++++++++++-------------------- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/src/PlanView/SimpleItemEditor.qml b/src/PlanView/SimpleItemEditor.qml index 06d9e62d7..97c3f3a3d 100644 --- a/src/PlanView/SimpleItemEditor.qml +++ b/src/PlanView/SimpleItemEditor.qml @@ -82,47 +82,43 @@ Rectangle { GridLayout { anchors.left: parent.left anchors.right: parent.right + flow: GridLayout.TopToBottom + rows: missionItem.textFieldFacts.count + missionItem.nanFacts.count + (missionItem.speedSection.available ? 1 : 0) columns: 2 Repeater { model: missionItem.textFieldFacts - QGCLabel { + QGCLabel { text: object.name } + } + + Repeater { + model: missionItem.nanFacts + + QGCCheckBox { text: object.name - Layout.column: 0 - Layout.row: index + checked: !isNaN(object.rawValue) + onClicked: object.rawValue = checked ? 0 : NaN } } + QGCCheckBox { + id: flightSpeedCheckbox + text: qsTr("Flight Speed") + checked: missionItem.speedSection.specifyFlightSpeed + onClicked: missionItem.speedSection.specifyFlightSpeed = checked + visible: missionItem.speedSection.available + } + Repeater { model: missionItem.textFieldFacts FactTextField { showUnits: true fact: object - Layout.column: 1 - Layout.row: index Layout.fillWidth: true } } - } - - GridLayout { - anchors.left: parent.left - anchors.right: parent.right - columns: 2 - - Repeater { - model: missionItem.nanFacts - - QGCCheckBox { - text: object.name - Layout.column: 0 - Layout.row: index - checked: !isNaN(object.rawValue) - onClicked: object.rawValue = checked ? 0 : NaN - } - } Repeater { model: missionItem.nanFacts @@ -130,31 +126,16 @@ Rectangle { FactTextField { showUnits: true fact: object - Layout.column: 1 - Layout.row: index Layout.fillWidth: true enabled: !isNaN(object.rawValue) } } - } - - RowLayout { - anchors.left: parent.left - anchors.right: parent.right - spacing: ScreenTools.defaultFontPixelWidth - visible: missionItem.speedSection.available - - QGCCheckBox { - id: flightSpeedCheckbox - text: qsTr("Flight Speed") - checked: missionItem.speedSection.specifyFlightSpeed - onClicked: missionItem.speedSection.specifyFlightSpeed = checked - } FactTextField { fact: missionItem.speedSection.flightSpeed Layout.fillWidth: true enabled: flightSpeedCheckbox.checked + visible: missionItem.speedSection.available } } -- 2.22.0