Commit 1a2ce057 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4527 from DonLakeFlyer/SimpleMission

Plan-Simple Item: Use all remaining width for text fields
parents 21ebc83a 61226f2d
...@@ -2,6 +2,7 @@ import QtQuick 2.5 ...@@ -2,6 +2,7 @@ import QtQuick 2.5
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.2
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.2
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
...@@ -42,65 +43,65 @@ Rectangle { ...@@ -42,65 +43,65 @@ Rectangle {
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pointSize: ScreenTools.smallFontPointSize font.pointSize: ScreenTools.smallFontPointSize
text: missionItem.sequenceNumber == 0 ? text: missionItem.rawEdit ?
qsTr("Planned home position. Actual home position set by Vehicle.") :
(missionItem.rawEdit ?
qsTr("Provides advanced access to all commands/parameters. Be very careful!") : qsTr("Provides advanced access to all commands/parameters. Be very careful!") :
missionItem.commandDescription) missionItem.commandDescription
} }
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
columns: 2
Repeater { Repeater {
model: missionItem.comboboxFacts model: missionItem.comboboxFacts
Item {
width: valuesColumn.width
height: comboBoxFact.height
QGCLabel { QGCLabel {
id: comboBoxLabel
anchors.baseline: comboBoxFact.baseline
text: object.name text: object.name
visible: object.name != "" visible: object.name != ""
Layout.column: 0
Layout.row: index
}
} }
Repeater {
model: missionItem.comboboxFacts
FactComboBox { FactComboBox {
id: comboBoxFact
anchors.right: parent.right
width: comboBoxLabel.visible ? _editFieldWidth : parent.width
indexModel: false indexModel: false
model: object.enumStrings model: object.enumStrings
fact: object fact: object
Layout.column: 1
Layout.row: index
Layout.fillWidth: true
} }
} }
} }
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
columns: 2
Repeater { Repeater {
model: missionItem.textFieldFacts model: missionItem.textFieldFacts
Item {
width: valuesColumn.width
height: textField.height
QGCLabel { QGCLabel {
id: textFieldLabel
anchors.baseline: textField.baseline
text: object.name text: object.name
Layout.column: 0
Layout.row: index
}
} }
Repeater {
model: missionItem.textFieldFacts
FactTextField { FactTextField {
id: textField
anchors.right: parent.right
width: _editFieldWidth
showUnits: true showUnits: true
fact: object fact: object
visible: !_root.readOnly Layout.column: 1
} Layout.row: index
Layout.fillWidth: true
FactLabel {
anchors.baseline: textFieldLabel.baseline
anchors.right: parent.right
fact: object
visible: _root.readOnly
} }
} }
} }
...@@ -113,13 +114,6 @@ Rectangle { ...@@ -113,13 +114,6 @@ Rectangle {
fact: object fact: object
} }
} }
QGCButton {
text: qsTr("Move Home to map center")
visible: missionItem.homePosition
onClicked: editorRoot.moveHomeToMapCenter()
anchors.horizontalCenter: parent.horizontalCenter
}
} // Column } // Column
} // Item } // Item
} // Component } // Component
......
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