Unverified Commit 19e998a5 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8009 from DonLakeFlyer/PlanItemDelete

Plan mission item editor: Delete icon and Command Picker ui
parents 3b4a9ca9 e9052893
...@@ -3,6 +3,7 @@ import QtQuick.Controls 2.4 ...@@ -3,6 +3,7 @@ import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQml 2.2 import QtQml 2.2
import QtQuick.Layouts 1.11
import QGroundControl 1.0 import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
...@@ -214,15 +215,66 @@ Rectangle { ...@@ -214,15 +215,66 @@ Rectangle {
} }
} }
QGCButton { QGCColoredImage {
id: commandPicker id: deleteButton
anchors.topMargin: _margin anchors.margins: _margin
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.leftMargin: _margin
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.verticalCenter: commandPicker.verticalCenter
visible: !commandLabel.visible height: _hamburgerSize
text: missionItem.commandName width: height
sourceSize.height: height
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
color: qgcPal.text
visible: _currentItem && missionItem.sequenceNumber !== 0
source: "/res/TrashDelete.svg"
QGCMouseArea {
fillItem: parent
onClicked: remove()
}
}
Rectangle {
id: commandPicker
anchors.margins: _margin
anchors.left: deleteButton.right
anchors.top: parent.top
height: ScreenTools.implicitComboBoxHeight
width: innerLayout.x + innerLayout.width + ScreenTools.comboBoxPadding
visible: !commandLabel.visible
color: qgcPal.window
border.width: 1
border.color: qgcPal.text
RowLayout {
id: innerLayout
anchors.margins: _padding
anchors.left: parent.left
anchors.top: parent.top
spacing: _padding
property real _padding: ScreenTools.comboBoxPadding
QGCLabel { text: missionItem.commandName }
QGCColoredImage {
height: ScreenTools.implicitComboBoxHeight - (ScreenTools.comboBoxPadding * 2)
width: height
sourceSize.height: height
fillMode: Image.PreserveAspectFit
smooth: true
antialiasing: true
color: qgcPal.text
source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/double-arrow.png"
}
}
QGCMouseArea {
fillItem: parent
onClicked: mainWindow.showComponentDialog(commandDialog, qsTr("Select Mission Command"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
}
Component { Component {
id: commandDialog id: commandDialog
...@@ -233,15 +285,14 @@ Rectangle { ...@@ -233,15 +285,14 @@ Rectangle {
} }
} }
onClicked: mainWindow.showComponentDialog(commandDialog, qsTr("Select Mission Command"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
} }
QGCLabel { QGCLabel {
id: commandLabel id: commandLabel
anchors.leftMargin: ScreenTools.comboBoxPadding
anchors.fill: commandPicker anchors.fill: commandPicker
visible: !missionItem.isCurrentItem || !missionItem.isSimpleItem || _waypointsOnlyMode visible: !missionItem.isCurrentItem || !missionItem.isSimpleItem || _waypointsOnlyMode
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: missionItem.commandName text: missionItem.commandName
color: _outerTextColor color: _outerTextColor
} }
......
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