Newer
Older
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FactControls 1.0
signal clicked
signal remove
signal moveUp
signal moveDown
(missionItem.textFieldFacts.count * (measureTextField.height + _margin)) +
(missionItem.checkboxFacts.count * (measureCheckbox.height + _margin)) +
commandPicker.height + deleteButton.height + (_margin * 9) :
commandPicker.height + (_margin * 2)
color: missionItem.isCurrentItem ? qgcPal.buttonHighlight : qgcPal.windowShade
readonly property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 16
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 3
QGCPalette {
id: qgcPal
colorGroupEnabled: enabled
QGCTextField {
id: measureTextField
visible: false
}
QGCCheckBox {
id: measureCheckbox
visible: false
}
Item {
anchors.margins: _margin
anchors.fill: parent
id: label
anchors.verticalCenter: commandPicker.verticalCenter
isCurrentItem: missionItem.isCurrentItem
label: missionItem.sequenceNumber
}
MouseArea {
anchors.fill: parent
visible: !missionItem.isCurrentItem
onClicked: _root.clicked()
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 10
anchors.left: label.right
anchors.right: parent.right
currentIndex: missionItem.commandByIndex
model: missionItem.commandNames
anchors.top: commandPicker.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
color: qgcPal.windowShadeDark
Item {
anchors.margins: _margin
anchors.fill: parent
id: valuesColumn
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: _margin
height: textField.height
QGCLabel {
anchors.baseline: textField.baseline
text: object.name
}
FactTextField {
id: textField
anchors.right: parent.right
width: _editFieldWidth
showUnits: true
fact: object
}
}
}
Item {
width: 10
height: missionItem.textFieldFacts.count ? _margin : 0
}
Repeater {
model: missionItem.checkboxFacts
FactCheckBox {
id: textField
text: object.name
fact: object
}
}
Item {
width: 10
height: missionItem.checkboxFacts.count ? _margin : 0
Row {
width: parent.width
spacing: _margin
readonly property real buttonWidth: (width - (_margin * 2)) / 3
QGCButton {
id: deleteButton
width: parent.buttonWidth
text: "Delete"
onClicked: _root.remove()
}
QGCButton {
width: parent.buttonWidth
text: "Up"
onClicked: _root.moveUp()
}
QGCButton {
width: parent.buttonWidth
text: "Down"
onClicked: _root.moveDown()
}