[vlc-commits] qml: fix drag positional list fade out in PlaylistListView

Fatih Uzunoglu git at videolan.org
Tue Jan 12 13:20:39 UTC 2021


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Jan  8 00:36:41 2021 +0300| [932eb5a5b7491c59e87ff957e63a22aa8496deb7] | committer: Pierre Lamot

qml: fix drag positional list fade out in PlaylistListView

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

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

 modules/gui/qt/playlist/qml/PlaylistListView.qml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/playlist/qml/PlaylistListView.qml b/modules/gui/qt/playlist/qml/PlaylistListView.qml
index 4e1e620ebe..a16af0f965 100644
--- a/modules/gui/qt/playlist/qml/PlaylistListView.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistListView.qml
@@ -101,11 +101,11 @@ Widgets.NavigableFocusScope {
             }
 
             on_PosChanged: {
-                var dragItemY = root.mapToGlobal(dragItem._pos.x, dragItem._pos.y).y
-                var viewY     = root.mapToGlobal(listView.x, listView.y).y
+                var dragItemY = dragItem._pos.y
+                var viewY     = root.mapFromItem(listView, listView.x, listView.y).y
 
                 var topDiff    = (viewY + VLCStyle.dp(20, VLCStyle.scale)) - dragItemY
-                var bottomDiff = dragItemY - (viewY + listView.height - VLCStyle.dp(20, VLCStyle.scale))
+                var bottomDiff = dragItemY - (viewY + listView.height - toolbar.height - VLCStyle.dp(20, VLCStyle.scale))
 
                 if(!listView.listView.atYBeginning && topDiff > 0) {
                     _scrollingDirection = -1
@@ -624,6 +624,8 @@ Widgets.NavigableFocusScope {
             }
 
             PlaylistToolbar {
+                id: toolbar
+
                 Layout.fillWidth: true
 
                 Layout.leftMargin: root.leftPadding



More information about the vlc-commits mailing list