From 8c8ba221d3050c45595b33ee893ec4c8c75db456 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 10 Dec 2019 14:23:14 -0400 Subject: [PATCH] HDrawer resizer: use MouseArea's pressed prop --- src/qml/Base/HDrawer.qml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qml/Base/HDrawer.qml b/src/qml/Base/HDrawer.qml index 43fc3e5b..d191cfae 100644 --- a/src/qml/Base/HDrawer.qml +++ b/src/qml/Base/HDrawer.qml @@ -87,24 +87,21 @@ Drawer { (horizontal ? Qt.SizeHorCursor : Qt.SizeVerCursor) : Qt.ArrowCursor - onPressed: canResize = true - onReleased: {canResize = false; userResized(drawer.preferredSize)} - onMouseXChanged: - if (horizontal && canResize) { + if (horizontal && pressed) { drawer.preferredSize = drawer.calculatedSize + (drawer.edge === Qt.RightEdge ? -mouseX : mouseX) } onMouseYChanged: - if (vertical && canResize) { + if (vertical && pressed) { drawer.preferredSize = drawer.calculatedSize + (drawer.edge === Qt.BottomEdge ? -mouseY : mouseY) } - property bool canResize: false + onReleased: userResized(drawer.preferredSize) } } }