From 8cd6f3f5b61af666824abbf710375054c6f2af35 Mon Sep 17 00:00:00 2001 From: Jaquee Date: Wed, 3 May 2017 11:08:59 +0200 Subject: Make dialogs draggable --- components/DaemonManagerDialog.qml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'components/DaemonManagerDialog.qml') diff --git a/components/DaemonManagerDialog.qml b/components/DaemonManagerDialog.qml index 0780b513..77908b1f 100644 --- a/components/DaemonManagerDialog.qml +++ b/components/DaemonManagerDialog.qml @@ -53,6 +53,15 @@ Window { width: 480 height: 200 + // Make window draggable + MouseArea { + anchors.fill: parent + property point lastMousePos: Qt.point(0, 0) + onPressed: { lastMousePos = Qt.point(mouseX, mouseY); } + onMouseXChanged: root.x += (mouseX - lastMousePos.x) + onMouseYChanged: root.y += (mouseY - lastMousePos.y) + } + ColumnLayout { id: mainLayout spacing: 10 -- cgit v1.2.3