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

alt stuff added to MeasurementComplexItem

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