Fix bar module position reset on click
This commit is contained in:
@@ -1109,6 +1109,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onReleased: function(mouse) {
|
onReleased: function(mouse) {
|
||||||
|
var wasDragging = dragging
|
||||||
if (dragging) {
|
if (dragging) {
|
||||||
suppressClick = true
|
suppressClick = true
|
||||||
}
|
}
|
||||||
@@ -1123,17 +1124,24 @@ Item {
|
|||||||
dragging = false
|
dragging = false
|
||||||
root.barDragTarget = null
|
root.barDragTarget = null
|
||||||
root.barDragAfter = false
|
root.barDragAfter = false
|
||||||
slot.x = 0
|
if (wasDragging) {
|
||||||
slot.y = 0
|
slot.x = 0
|
||||||
|
slot.y = 0
|
||||||
|
if (slot.parent && typeof slot.parent.forceLayout === "function") slot.parent.forceLayout()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onCanceled: {
|
onCanceled: {
|
||||||
|
var wasDragging = dragging
|
||||||
dragging = false
|
dragging = false
|
||||||
suppressClick = false
|
suppressClick = false
|
||||||
root.barDragTarget = null
|
root.barDragTarget = null
|
||||||
root.barDragAfter = false
|
root.barDragAfter = false
|
||||||
slot.x = 0
|
if (wasDragging) {
|
||||||
slot.y = 0
|
slot.x = 0
|
||||||
|
slot.y = 0
|
||||||
|
if (slot.parent && typeof slot.parent.forceLayout === "function") slot.parent.forceLayout()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: function(mouse) {
|
onClicked: function(mouse) {
|
||||||
|
|||||||
Reference in New Issue
Block a user