vlc | branch: master | Romain Vimont <[email protected]> | Fri Jul 12 16:20:37 2019 +0200| [ac45c291446695aead0555a6f6d61bac2b7cd649] | committer: Jean-Baptiste Kempf
qt: playlist: use the drag object The drag&drop was initiated using "pressed" and "released" signals on MouseArea. Instead, use "drag.active", which takes a move threshold before initiating a drag&drop. Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ac45c291446695aead0555a6f6d61bac2b7cd649 --- modules/gui/qt/qml/playlist/PLItem.qml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/gui/qt/qml/playlist/PLItem.qml b/modules/gui/qt/qml/playlist/PLItem.qml index 7d14628a1b..8d18128f0a 100644 --- a/modules/gui/qt/qml/playlist/PLItem.qml +++ b/modules/gui/qt/qml/playlist/PLItem.qml @@ -71,21 +71,23 @@ Rectangle { drag.target: dragItem - onPositionChanged: { - if (pressed && !dragItem.visible) { - dragItem.count = plmodel.getSelection().length - dragItem.visible = true + Connections { + target: mouse.drag + onActiveChanged: { + if (target.active) { + dragItem.count = plmodel.getSelection().length + dragItem.visible = true + } else { + dragItem.Drag.drop() + dragItem.visible = false + } } } + onPressed: { var pos = this.mapToGlobal( mouseX, mouseY) dragItem.updatePos(pos.x, pos.y) } - onReleased: { - if (dragItem.visible) - dragItem.Drag.drop() - dragItem.visible = false - } RowLayout { id: content _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
