From 8d0eaf1697ff8bf69f982313d0f0b78565c2f94d Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 27 Jul 2021 01:28:54 +0800 Subject: [PATCH] Improve desktop view drag --- qml/FolderGridItem.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/qml/FolderGridItem.qml b/qml/FolderGridItem.qml index 62197f4..f43a86d 100644 --- a/qml/FolderGridItem.qml +++ b/qml/FolderGridItem.qml @@ -41,6 +41,25 @@ Item { property bool blank: model.blank property var fileName: model.fileName + // For desktop + visible: GridView.view.isDesktopView ? !blank : true + + onSelectedChanged: { + if (!GridView.view.isDesktopView) + return + + if (selected && !blank) { + control.grabToImage(function(result) { + dirModel.addItemDragImage(control.index, + control.x, + control.y, + control.width, + control.height, + result.image) + }) + } + } + Rectangle { id: _background width: Math.max(_iconItem.width, _label.paintedWidth)