From 58c298ac464a1fe6a22b181d239c843b58b71d80 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Thu, 5 Apr 2018 15:30:14 -0700 Subject: [PATCH] Much better ui --- src/FlightMap/Widgets/ValuePageWidget.qml | 146 ++++++++++++---------- 1 file changed, 80 insertions(+), 66 deletions(-) diff --git a/src/FlightMap/Widgets/ValuePageWidget.qml b/src/FlightMap/Widgets/ValuePageWidget.qml index b68146cdd..c334a9616 100644 --- a/src/FlightMap/Widgets/ValuePageWidget.qml +++ b/src/FlightMap/Widgets/ValuePageWidget.qml @@ -134,7 +134,7 @@ Column { QGCFlickable { anchors.fill: parent - contentHeight: _loader.y + _loader.height + contentHeight: column.height flickableDirection: Flickable.VerticalFlick clip: true @@ -169,13 +169,26 @@ Column { } Loader { - id: _loader anchors.left: parent.left anchors.right: parent.right sourceComponent: factGroupList property var factGroup: _activeVehicle - property string factGroupName: "Vehicle" + property string factGroupName: qsTr("Vehicle") + } + + Repeater { + model: _activeVehicle.factGroupNames + + Loader { + anchors.left: parent.left + anchors.right: parent.right + sourceComponent: factGroupList + + property var factGroup: _activeVehicle.getFactGroup(modelData) + property string factGroupName: modelData + } + } } } @@ -190,91 +203,92 @@ Column { // property string factGroupName Column { - id: _root spacing: _margins - QGCLabel { - width: parent.width - wrapMode: Text.WordWrap - text: factGroup ? factGroupName : qsTr("Vehicle must be connected to assign values.") + SectionHeader { + id: header + anchors.left: parent.left + anchors.right: parent.right + text: factGroupName.charAt(0).toUpperCase() + factGroupName.slice(1) + checked: false } - Repeater { - model: factGroup ? factGroup.factNames : 0 + Column { + spacing: _margins + visible: header.checked + + Repeater { + model: factGroup ? factGroup.factNames : 0 - RowLayout { - spacing: _margins + RowLayout { + spacing: _margins - property string propertyName: factGroupName + "." + modelData + property string propertyName: factGroupName + "." + modelData - function removeFromList(list, value) { - var newList = [] - for (var i=0; i