mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 05:23:58 -06:00
DoubleClick and drag no longer contradict eachother for expandable component
CURA-6478
This commit is contained in:
parent
19cd8f4edc
commit
56c0cae71f
1 changed files with 13 additions and 4 deletions
|
@ -268,23 +268,32 @@ Item
|
|||
right: contentHeader.xPosCloseButton
|
||||
}
|
||||
property var clickPos: Qt.point(0, 0)
|
||||
|
||||
property bool dragging: false
|
||||
onPressed:
|
||||
{
|
||||
clickPos = Qt.point(mouse.x, mouse.y);
|
||||
dragging = true
|
||||
}
|
||||
|
||||
onPositionChanged:
|
||||
{
|
||||
var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y);
|
||||
if (delta.x !== 0 || delta.y !== 0)
|
||||
if(dragging)
|
||||
{
|
||||
contentContainer.trySetPosition(contentContainer.x + delta.x, contentContainer.y + delta.y);
|
||||
var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y);
|
||||
if (delta.x !== 0 || delta.y !== 0)
|
||||
{
|
||||
contentContainer.trySetPosition(contentContainer.x + delta.x, contentContainer.y + delta.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
onReleased:
|
||||
{
|
||||
dragging = false
|
||||
}
|
||||
|
||||
onDoubleClicked:
|
||||
{
|
||||
dragging = false
|
||||
contentContainer.trySetPosition(0, 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue