Merge pull request #622 from disq/feat/drag-and-drop-files

feat: Allow image drag/drop
This commit is contained in:
maxnet 2023-09-22 20:20:27 +02:00 committed by GitHub
commit 5968cb37b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -342,6 +342,20 @@ ApplicationWindow {
} }
} }
} }
DropArea {
anchors.fill: parent
onEntered: {
if (drag.active && mimeData.hasUrls()) {
drag.acceptProposedAction()
}
}
onDropped: {
if (drop.urls && drop.urls.length > 0) {
onFileSelected(drop.urls[0].toString())
}
}
}
} }
} }