Browse Source

Use all remaining width for text fields

Done by using GridLayout
QGC4.4
Don Gagne 8 years ago
parent
commit
61226f2dd0
  1. 88
      src/MissionEditor/SimpleItemEditor.qml

88
src/MissionEditor/SimpleItemEditor.qml

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

Loading…
Cancel
Save