From 56c0cae71f764f6a7e94d1cc757395a85bc6f0e2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 29 Apr 2019 15:13:01 +0200 Subject: [PATCH] DoubleClick and drag no longer contradict eachother for expandable component CURA-6478 --- resources/qml/ExpandableComponent.qml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 8803c08b19..b3fe3fa763 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -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); }