Improve desktop view drag

This commit is contained in:
reionwong 2021-07-27 01:28:54 +08:00
parent 23fb2d13d8
commit 8d0eaf1697

View file

@ -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)