[vlc-commits] qt: playlist: use existing "pressed" property

Romain Vimont git at videolan.org
Tue Jul 16 14:20:53 CEST 2019


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Fri Jul 12 16:20:36 2019 +0200| [4c4e93bdc0f986cb6b4ffbbd47a19070117e1ee7] | committer: Jean-Baptiste Kempf

qt: playlist: use existing "pressed" property

MouseArea contains a "pressed" property. There is no need to maintain
our own.

<https://doc.qt.io/qt-5/qml-qtquick-mousearea.html#pressed-prop>

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4c4e93bdc0f986cb6b4ffbbd47a19070117e1ee7
---

 modules/gui/qt/qml/playlist/PLItem.qml | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/modules/gui/qt/qml/playlist/PLItem.qml b/modules/gui/qt/qml/playlist/PLItem.qml
index fa75adbea2..7d14628a1b 100644
--- a/modules/gui/qt/qml/playlist/PLItem.qml
+++ b/modules/gui/qt/qml/playlist/PLItem.qml
@@ -71,15 +71,13 @@ Rectangle {
 
         drag.target: dragItem
 
-        property bool hold: false
         onPositionChanged: {
-            if (hold && !dragItem.visible) {
+            if (pressed && !dragItem.visible) {
                 dragItem.count = plmodel.getSelection().length
                 dragItem.visible = true
             }
         }
         onPressed:  {
-            hold = true
             var pos = this.mapToGlobal( mouseX, mouseY)
             dragItem.updatePos(pos.x, pos.y)
         }
@@ -87,7 +85,6 @@ Rectangle {
             if (dragItem.visible)
                 dragItem.Drag.drop()
             dragItem.visible = false
-            hold = false
         }
 
         RowLayout {



More information about the vlc-commits mailing list