From 8c3e5b2b48fb343553a19402fe9fb414b30606c0 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 16 Nov 2020 22:14:53 +0000 Subject: [PATCH] Add drop area for conveniently share files --- imports/NeoChat/Page/RoomPage.qml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/imports/NeoChat/Page/RoomPage.qml b/imports/NeoChat/Page/RoomPage.qml index 678e1d7ef..ad8b11bb2 100644 --- a/imports/NeoChat/Page/RoomPage.qml +++ b/imports/NeoChat/Page/RoomPage.qml @@ -357,6 +357,26 @@ Kirigami.ScrollablePage { } } + DropArea { + id: dropAreaFile + anchors.fill: parent + onDropped: chatTextInput.attach(drop.urls[0]) + } + + QQC2.Pane { + visible: dropAreaFile.containsDrag + anchors { + fill: parent + margins: Kirigami.Units.gridUnit + } + + Kirigami.PlaceholderMessage { + anchors.centerIn: parent + width: parent.width - (Kirigami.Units.largeSpacing * 4) + text: i18n("Drag items here to share them") + } + } + footer: ChatTextInput { id: chatTextInput Layout.fillWidth: true