Browse Source

Delete icon and Command Picker ui

QGC4.4
DonLakeFlyer 6 years ago
parent
commit
e9052893cc
  1. 67
      src/PlanView/MissionItemEditor.qml

67
src/PlanView/MissionItemEditor.qml

@ -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 {
} }
} }
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.verticalCenter: commandPicker.verticalCenter
height: _hamburgerSize
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 anchors.top: parent.top
height: ScreenTools.implicitComboBoxHeight
width: innerLayout.x + innerLayout.width + ScreenTools.comboBoxPadding
visible: !commandLabel.visible visible: !commandLabel.visible
text: missionItem.commandName 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 {
} }
} }
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
} }

Loading…
Cancel
Save