Newer
Older
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.2
import QtQuick.Dialogs 1.2
import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0
// Editor for Simple mission items
Rectangle {
id: valuesRect
width: availableWidth
Nate Weibley
committed
height: deferedload.status == Loader.Ready ? (visible ? deferedload.item.height : 0) : 0
color: qgcPal.windowShadeDark
visible: missionItem.isCurrentItem
radius: _radius
Nate Weibley
committed
Loader {
id: deferedload
active: valuesRect.visible
asynchronous: true
anchors.margins: _margin
anchors.left: valuesRect.left
anchors.right: valuesRect.right
anchors.top: valuesRect.top
sourceComponent: Component {
Item {
id: valuesItem
height: valuesColumn.height + (_margin * 2)
Column {
id: valuesColumn
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: _margin
Nate Weibley
committed
width: parent.width
wrapMode: Text.WordWrap
font.pointSize: ScreenTools.smallFontPointSize
text: missionItem.rawEdit ?
qsTr("Provides advanced access to all commands/parameters. Be very careful!") :
missionItem.commandDescription
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
columns: 2
Nate Weibley
committed
Repeater {
model: missionItem.comboboxFacts
Nate Weibley
committed
QGCLabel {
text: object.name
visible: object.name != ""
Layout.column: 0
Layout.row: index
Nate Weibley
committed
}
}
Repeater {
model: missionItem.comboboxFacts
Nate Weibley
committed
FactComboBox {
indexModel: false
model: object.enumStrings
fact: object
Layout.column: 1
Layout.row: index
Layout.fillWidth: true
Nate Weibley
committed
}
}
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
columns: 2
Nate Weibley
committed
Repeater {
model: missionItem.textFieldFacts
Nate Weibley
committed
QGCLabel {
text: object.name
Layout.column: 0
Layout.row: index
Nate Weibley
committed
}
Nate Weibley
committed
Repeater {
model: missionItem.textFieldFacts
Nate Weibley
committed
Nate Weibley
committed
fact: object
Layout.column: 1
Layout.row: index
Layout.fillWidth: true
Nate Weibley
committed
}
}
Nate Weibley
committed
Repeater {
model: missionItem.checkboxFacts
FactCheckBox {
text: object.name
fact: object
}
Nate Weibley
committed
} // Column
} // Item
} // Component
} // Loader