Commit 31d4efc3 authored by Valentin Platzgummer's avatar Valentin Platzgummer

alt stuff added to MeasurementComplexItem

parent 96ac6aeb
...@@ -16,7 +16,6 @@ GridLayout { ...@@ -16,7 +16,6 @@ GridLayout {
property var _areaData: missionItem.areaData property var _areaData: missionItem.areaData
property real _margin: ScreenTools.defaultFontPixelWidth / 2 property real _margin: ScreenTools.defaultFontPixelWidth / 2
width: availableWidth
columnSpacing: _margin columnSpacing: _margin
rowSpacing: _margin rowSpacing: _margin
columns: 2 columns: 2
...@@ -58,12 +57,15 @@ GridLayout { ...@@ -58,12 +57,15 @@ GridLayout {
ColumnLayout { ColumnLayout {
id:editorParent id:editorParent
Layout.fillWidth: true Layout.fillWidth: true
Layout.maximumWidth: parent.width
Layout.columnSpan: 2 Layout.columnSpan: 2
} }
Repeater{ Repeater{
id:areaEditorRepeater id:areaEditorRepeater
Layout.maximumWidth: parent.width
model: _missionItem.areaData.areaList model: _missionItem.areaData.areaList
delegate: Item{ delegate: Item{
id:editor id:editor
......
...@@ -14,18 +14,21 @@ import QGroundControl.FactControls 1.0 ...@@ -14,18 +14,21 @@ import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.FlightMap 1.0 import QGroundControl.FlightMap 1.0
ColumnLayout { GridLayout {
id:root id:_root
property int availableWidth: 300
property var missionItem: undefined ///< Mission Item for editor
property bool checked: true property bool checked: true
property var missionItem: undefined
property int availableWidth: 300
property real _margin: ScreenTools.defaultFontPixelWidth / 2 property real _margin: ScreenTools.defaultFontPixelWidth / 2
property var _generator: missionItem.generator property var _generator: missionItem.generator
property var _generatorEditor: undefined property var _generatorEditor: undefined
width: availableWidth width: availableWidth
columnSpacing: _margin
rowSpacing: _margin
columns: 2
Component.onCompleted: { Component.onCompleted: {
console.assert(missionItem !== undefined, "please set the missionItem property") console.assert(missionItem !== undefined, "please set the missionItem property")
...@@ -46,6 +49,8 @@ ColumnLayout { ...@@ -46,6 +49,8 @@ ColumnLayout {
SectionHeader { SectionHeader {
id: generalHeader id: generalHeader
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: parent.columns
Layout.maximumWidth: parent.width
text: qsTr("General") text: qsTr("General")
} }
...@@ -53,6 +58,8 @@ ColumnLayout { ...@@ -53,6 +58,8 @@ ColumnLayout {
GridLayout { GridLayout {
id: generalGrid id: generalGrid
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: parent.columns
Layout.maximumWidth: parent.width
columnSpacing: _margin columnSpacing: _margin
rowSpacing: _margin rowSpacing: _margin
columns: 2 columns: 2
...@@ -67,22 +74,21 @@ ColumnLayout { ...@@ -67,22 +74,21 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
} }
QGCLabel { text: qsTr("Relative Altitude!!!") }
QGCLabel { QGCLabel {
text: qsTr("Variant") text: qsTr("Variant")
Layout.columnSpan: 2 Layout.columnSpan: parent.columns
visible: variantRepeater.len > 0 visible: variantRepeater.len > 0
} }
ExclusiveGroup{id:variantGroup}
GridLayout{ GridLayout{
Layout.columnSpan: 2 Layout.columnSpan: parent.columns
Layout.fillWidth: true Layout.maximumWidth: parent.width
Layout.maximumWidth: parent.width
columnSpacing: _margin columnSpacing: _margin
rowSpacing: _margin rowSpacing: _margin
ExclusiveGroup{id:variantGroup}
Repeater{ Repeater{
id: variantRepeater id: variantRepeater
...@@ -91,20 +97,20 @@ ColumnLayout { ...@@ -91,20 +97,20 @@ ColumnLayout {
model: len model: len
delegate: QGCRadioButton { delegate: QGCRadioButton {
checked: index === variant checked: index === variantIndex
text: variantRepeater.names[index] ? variantRepeater.names[index]: "" text: variantRepeater.names[index] ? variantRepeater.names[index]: ""
property int variant: missionItem.variant.value property int variantIndex: missionItem.variantIndex.value
onVariantChanged: { onVariantIndexChanged: {
if (variant === index){ if (variantIndex === index){
checked = true checked = true
} }
} }
onCheckedChanged: { onCheckedChanged: {
if (checked && variant !== index){ if (checked && variantIndex !== index){
missionItem.variant.value = index missionItem.variantIndex.value = index
} }
} }
} }
...@@ -116,12 +122,15 @@ ColumnLayout { ...@@ -116,12 +122,15 @@ ColumnLayout {
SectionHeader { SectionHeader {
id: generatorHeader id: generatorHeader
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: parent.columns
text: qsTr("Generator") text: qsTr("Generator")
} }
GridLayout{ GridLayout{
Layout.fillWidth: true Layout.fillWidth: true
columnSpacing: _margin columnSpacing: _margin
Layout.maximumWidth: parent.width
Layout.columnSpan: parent.columns
rowSpacing: _margin rowSpacing: _margin
columns: 2 columns: 2
visible: generatorHeader.checked visible: generatorHeader.checked
...@@ -130,7 +139,7 @@ ColumnLayout { ...@@ -130,7 +139,7 @@ ColumnLayout {
property var names: missionItem.generatorNameList property var names: missionItem.generatorNameList
property int length: names.length property int length: names.length
enabled: root.checked enabled: _root.checked
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
currentIndex: missionItem.generatorIndex currentIndex: missionItem.generatorIndex
Layout.columnSpan: 2 Layout.columnSpan: 2
...@@ -147,6 +156,8 @@ ColumnLayout { ...@@ -147,6 +156,8 @@ ColumnLayout {
ColumnLayout{ ColumnLayout{
id:generatorEditorParent id:generatorEditorParent
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: parent.columns
Layout.maximumWidth: parent.width
visible: generatorHeader.checked visible: generatorHeader.checked
} }
...@@ -161,6 +172,7 @@ ColumnLayout { ...@@ -161,6 +172,7 @@ ColumnLayout {
ColumnLayout{ ColumnLayout{
Layout.fillWidth: true Layout.fillWidth: true
spacing: _margin spacing: _margin
Layout.maximumWidth: parent.width
BusyIndicator{ BusyIndicator{
id: indicator id: indicator
...@@ -196,7 +208,7 @@ ColumnLayout { ...@@ -196,7 +208,7 @@ ColumnLayout {
_generatorEditor = _generatorEditor =
component.createObject( component.createObject(
generatorEditorParent, { generatorEditorParent, {
"generator": root._generator, "generator": _root._generator,
"availableWidth": generatorEditorParent.width, "availableWidth": generatorEditorParent.width,
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment