Improve desktop view drag
This commit is contained in:
parent
23fb2d13d8
commit
8d0eaf1697
1 changed files with 19 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue