From 030ff0994dfefd966c0b3bfbe3634040f20da9c4 Mon Sep 17 00:00:00 2001 From: xiphon Date: Tue, 3 Jul 2018 19:56:23 +0300 Subject: [PATCH] mobile view: draggable window --- main.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/main.qml b/main.qml index 0672693c..776f2139 100644 --- a/main.qml +++ b/main.qml @@ -1295,6 +1295,25 @@ ApplicationWindow { anchors.left: parent.left anchors.right: parent.right height: visible? 65 * scaleRatio : 0 + + MouseArea { + enabled: persistentSettings.customDecorations + property var previousPosition + anchors.fill: parent + propagateComposedEvents: true + onPressed: previousPosition = globalCursor.getPosition() + onPositionChanged: { + if (pressedButtons == Qt.LeftButton) { + var pos = globalCursor.getPosition() + var dx = pos.x - previousPosition.x + var dy = pos.y - previousPosition.y + + appWindow.x += dx + appWindow.y += dy + previousPosition = pos + } + } + } } LeftPanel {