Added the ability to cancel the position setting with right click.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
63d9f00e96
commit
9fd584f881
2 changed files with 34 additions and 29 deletions
|
@ -136,7 +136,7 @@ ListView {
|
|||
|
||||
onClicked: {
|
||||
positionPicker.objType = objType
|
||||
positionPicker.objName = Objects.currentObjects[objType][index].name
|
||||
positionPicker.objName = obj.name
|
||||
positionPicker.pickX = hasXProp
|
||||
positionPicker.pickY = hasYProp
|
||||
positionPicker.propertyX = 'x'
|
||||
|
@ -154,10 +154,12 @@ ListView {
|
|||
anchors.rightMargin: 5
|
||||
anchors.topMargin: 5
|
||||
icon.name: 'delete'
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: 'Delete ' + Objects.types[objType].displayType() + '.'
|
||||
|
||||
onClicked: {
|
||||
history.addToHistory(new HistoryLib.DeleteObject(
|
||||
Objects.currentObjects[objType][index].name, objType, Objects.currentObjects[objType][index].export()
|
||||
obj.name, objType, obj.export()
|
||||
))
|
||||
Objects.currentObjects[objType][index].delete()
|
||||
Objects.currentObjects[objType].splice(index, 1)
|
||||
|
|
|
@ -46,7 +46,9 @@ Item {
|
|||
anchors.fill: parent
|
||||
hoverEnabled: parent.visible
|
||||
cursorShape: Qt.CrossCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: {
|
||||
if(mouse.button == Qt.LeftButton) { // Validate
|
||||
if(parent.pickX) {
|
||||
var newValue = canvas.px2x(picker.mouseX).toFixed(parent.precision)
|
||||
newValue = {
|
||||
|
@ -75,6 +77,7 @@ Item {
|
|||
obj.update()
|
||||
objectLists.update()
|
||||
}
|
||||
}
|
||||
pickerRoot.visible = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue