[vlc-commits] qml: Use EditorDNDView in Editor

Rohan Rajpal git at videolan.org
Wed Aug 21 16:27:00 CEST 2019


vlc | branch: master | Rohan Rajpal <rohan17089 at iiitd.ac.in> | Sat Aug 10 23:19:04 2019 +0530| [498812de5e61200f43d779cacc3f5f0f103b8a30] | committer: Jean-Baptiste Kempf

qml: Use EditorDNDView in Editor

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

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

 modules/gui/qt/qml/dialogs/ToolbarEditor.qml | 75 ++--------------------------
 1 file changed, 3 insertions(+), 72 deletions(-)

diff --git a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
index d2b1b83f4d..76fe299c9c 100644
--- a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
+++ b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
@@ -54,79 +54,10 @@ Rectangle{
                 border.color: VLCStyle.colors.buttonText
                 color: "transparent"
 
-                ListView {
-                    id: playerBtnDND
-                    anchors{
-                        fill: parent
-                        margins: VLCStyle.heightBar_xxsmall
-                    }
-                    spacing: VLCStyle.margin_xxsmall
-                    orientation: Qt.Horizontal
-                    clip: true
-                    property bool deleteBtn: false
-                    property bool addBtn: false
-                    onDeleteBtnChanged: {
-                        if(deleteBtn)
-                            toolbareditor.deleteCursor()
-                        else
-                            toolbareditor.restoreCursor()
-                    }
-
-                    ScrollBar.horizontal: ScrollBar {}
-
-                    footer: Item {
-                        height: VLCStyle.icon_medium
-                        width: height
-                        property bool dropVisible: false
-                        Rectangle {
-                            z: 2
-                            width: 2 * scale
-                            height: parent.height
-                            anchors {
-                                left: parent.left
-                            }
-                            antialiasing: true
-                            visible: dropVisible
-                            color: VLCStyle.colors.accent
-                        }
-                        DropArea {
-                            anchors.fill: parent
-
-                            onEntered: {
-                                dropVisible = true
-                                playerBtnDND.deleteBtn = false
-                            }
-
-                            onExited: {
-                                dropVisible = false
-                                playerBtnDND.deleteBtn = true
-                            }
-
-                            onDropped: {
-                                if (drag.source.objectName == "buttonsList"){
-                                    playerBtnDND.model.insert(playerBtnDND.count,
-                                                             {"id" : drag.source.mIndex,
-                                                                 "size": bigButton.checked ?
-                                                                             PlayerControlBarModel.WIDGET_BIG :
-                                                                             PlayerControlBarModel.WIDGET_NORMAL})
-                                }
-                                else
-                                    playerBtnDND.model.move(
-                                                drag.source.DelegateModel.itemsIndex,
-                                                playerBtnDND.count-1)
-                                dropVisible = false
-                            }
-                        }
-
-                    }
-
+                EditorDNDView {
+                    id : playerBtnDND
+                    anchors.fill: parent
                     model: playerControlBarModel
-                    delegate: EditorDNDDelegate {
-                        dndView: playerBtnDND
-                    }
-                    displaced: Transition {
-                        NumberAnimation { properties: "x,y"; easing.type: Easing.OutQuad }
-                    }
                 }
             }
         }



More information about the vlc-commits mailing list