Commit d28bafba authored by Gus Grubba's avatar Gus Grubba

Double click to delete a vertex

parent 79f54537
......@@ -29,6 +29,7 @@ Rectangle {
property var itemCoordinate ///< Coordinate we are updating during drag
signal clicked
signal doubleClicked
signal dragStart
signal dragStop
......@@ -76,6 +77,11 @@ Rectangle {
itemDragger.clicked()
}
onDoubleClicked: {
focus = true
itemDragger.doubleClicked()
}
property bool dragActive: drag.active
onDragActiveChanged: {
if (dragActive) {
......
......@@ -291,7 +291,7 @@ Item {
}
}
onClicked: mapPolygon.removeVertex(polygonVertex)
onDoubleClicked: mapPolygon.removeVertex(polygonVertex)
}
}
......
......@@ -128,10 +128,10 @@ Item {
Menu {
id: menu
property int removeVertex
MenuItem {
id: removeVertexItem
text: qsTr("Remove vertex" )
onTriggered: mapPolyline.removeVertex(parent.removeVertex)
}
......@@ -140,6 +140,10 @@ Item {
text: qsTr("Load KML...")
onTriggered: kmlLoadDialog.openForLoad()
}
function resetMenu() {
removeVertexItem.visible = mapPolyline.count > 2
}
}
Component {
......@@ -167,7 +171,7 @@ Item {
width: ScreenTools.defaultFontPixelHeight * 1.5
height: width
radius: width / 2
border.color: "white"
border.color: "white"
color: "transparent"
opacity: .50
z: _zorderSplitHandle
......@@ -243,10 +247,13 @@ Item {
}
onClicked: {
if (polylineVertex == 0) {
menu.removeVertex = polylineVertex
menu.popup()
} else {
menu.resetMenu()
menu.removeVertex = polylineVertex
menu.popup()
}
onDoubleClicked: {
if (polylineVertex != 0) {
mapPolyline.removeVertex(polylineVertex)
}
}
......@@ -271,15 +278,7 @@ Item {
height: width
radius: width / 2
color: "white"
opacity: .90
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
text: "..."
color: "black"
visible: polylineVertex == 0
}
opacity: 0.9
}
}
}
......
......@@ -106,11 +106,11 @@ Rectangle {
QGCCheckBox {
id: relAlt
anchors.left: parent.left
text: qsTr("Relative altitude")
checked: missionItem.cameraCalc.distanceToSurfaceRelative
enabled: missionItem.cameraCalc.isManualCamera && !missionItem.followTerrain
visible: QGroundControl.corePlugin.options.showMissionAbsoluteAltitude || (!missionItem.cameraCalc.distanceToSurfaceRelative && !missionItem.followTerrain)
Layout.alignment: Qt.AlignLeft
Layout.columnSpan: 2
onClicked: missionItem.cameraCalc.distanceToSurfaceRelative = checked
......@@ -146,12 +146,11 @@ Rectangle {
}
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
columnSpacing: _margin
rowSpacing: _margin
columns: 2
visible: followsTerrainCheckBox.checked
Layout.fillWidth: true
columnSpacing: _margin
rowSpacing: _margin
columns: 2
visible: followsTerrainCheckBox.checked
QGCLabel { text: qsTr("Tolerance") }
FactTextField {
......
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