[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: fix dropping into playlist button no longer functional regression

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Aug 16 10:10:05 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d0d96894 by Fatih Uzunoglu at 2024-08-16T09:56:59+00:00
qml: fix dropping into playlist button no longer functional regression

- - - - -
392c9003 by Fatih Uzunoglu at 2024-08-16T09:56:59+00:00
qml: use playlist's drop acceptable function for probing

- - - - -


2 changed files:

- modules/gui/qt/maininterface/qml/BannerSources.qml
- modules/gui/qt/playlist/qml/PlaylistListView.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/BannerSources.qml
=====================================
@@ -436,16 +436,24 @@ T.ToolBar {
                                     }
 
                                     onEntered: (drag) => {
-                                        if (drag.hasUrls || Helpers.isValidInstanceOf(drag.source, Widgets.DragItem)) {
-                                            drag.accept() // Not actually necessary, as it is accepted by default
+                                        if (plListView) {
+                                            console.assert(plListView.isDropAcceptableFunc)
+                                            console.assert(plListView.model)
+                                            if (plListView.isDropAcceptableFunc(drag, plListView.model.count)) {
+                                                drag.accept()
+                                            } else {
+                                                drag.accepted = false
+                                            }
                                         } else {
                                             drag.accepted = false
                                         }
                                     }
 
                                     onDropped: (drop) => {
-                                        if (plListView)
-                                            plListView.acceptDrop(plListView.model.count, drop)
+                                        if (plListView) {
+                                            console.assert(plListView.acceptDropFunc)
+                                            plListView.acceptDropFunc(plListView.model.count, drop)
+                                        }
                                     }
 
                                     Timer {


=====================================
modules/gui/qt/playlist/qml/PlaylistListView.qml
=====================================
@@ -49,6 +49,9 @@ T.Pane {
 
     property alias dragItem: dragItem
 
+    property alias isDropAcceptableFunc: listView.isDropAcceptableFunc
+    property alias acceptDropFunc: listView.acceptDropFunc
+
     implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
                             contentWidth + leftPadding + rightPadding)
     implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/692046967ce6d76fcacda63ebb8c546bb0be7ee3...392c90037ebedb580d8805cf6575304a7d001757

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/692046967ce6d76fcacda63ebb8c546bb0be7ee3...392c90037ebedb580d8805cf6575304a7d001757
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list