mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-17 09:05:58 +08:00
DoubleClick and drag no longer contradict eachother for expandable component
CURA-6478
This commit is contained in:
parent
19cd8f4edc
commit
56c0cae71f
@ -268,23 +268,32 @@ Item
|
|||||||
right: contentHeader.xPosCloseButton
|
right: contentHeader.xPosCloseButton
|
||||||
}
|
}
|
||||||
property var clickPos: Qt.point(0, 0)
|
property var clickPos: Qt.point(0, 0)
|
||||||
|
property bool dragging: false
|
||||||
onPressed:
|
onPressed:
|
||||||
{
|
{
|
||||||
clickPos = Qt.point(mouse.x, mouse.y);
|
clickPos = Qt.point(mouse.x, mouse.y);
|
||||||
|
dragging = true
|
||||||
}
|
}
|
||||||
|
|
||||||
onPositionChanged:
|
onPositionChanged:
|
||||||
{
|
{
|
||||||
var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y);
|
if(dragging)
|
||||||
if (delta.x !== 0 || delta.y !== 0)
|
|
||||||
{
|
{
|
||||||
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:
|
onDoubleClicked:
|
||||||
{
|
{
|
||||||
|
dragging = false
|
||||||
contentContainer.trySetPosition(0, 0);
|
contentContainer.trySetPosition(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user