[vlc-devel] [PATCH 03/16] qml: fix bugged playlist drag item position update

Fatih Uzunoglu fuzun54 at outlook.com
Wed Jul 29 23:04:26 CEST 2020


---
 modules/gui/qt/playlist/qml/PLItem.qml  | 9 +++++++--
 modules/gui/qt/widgets/qml/DNDLabel.qml | 4 ++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt/playlist/qml/PLItem.qml b/modules/gui/qt/playlist/qml/PLItem.qml
index 56974e05be..cd673b112e 100644
--- a/modules/gui/qt/playlist/qml/PLItem.qml
+++ b/modules/gui/qt/playlist/qml/PLItem.qml
@@ -111,9 +111,14 @@ Rectangle {
             }
             else
                 __rightButton = false
+        }
 
-            var pos = this.mapToGlobal( mouseX, mouseY)
-            dragItem.updatePos(pos.x, pos.y)
+        onPositionChanged: {
+            if (dragItem.visible)
+            {
+                var pos = this.mapToGlobal( mouseX, mouseY)
+                dragItem.updatePos(pos.x + VLCStyle.dp(15), pos.y)
+            }
         }
 
         Rectangle {
diff --git a/modules/gui/qt/widgets/qml/DNDLabel.qml b/modules/gui/qt/widgets/qml/DNDLabel.qml
index 83176537d2..f7ce5af11f 100644
--- a/modules/gui/qt/widgets/qml/DNDLabel.qml
+++ b/modules/gui/qt/widgets/qml/DNDLabel.qml
@@ -39,8 +39,8 @@ Rectangle {
 
     function updatePos(x, y) {
         var pos = root.mapFromGlobal(x, y)
-        dragItem.x = pos.x + 10
-        dragItem.y = pos.y + 10
+        dragItem.x = pos.x
+        dragItem.y = pos.y
     }
 
     Text {
-- 
2.25.1



More information about the vlc-devel mailing list