[vlc-devel] [PATCH 09/23] qml: add animation to MainDisplay playlist

Fatih Uzunoglu fuzun54 at outlook.com
Thu Jul 2 15:21:54 CEST 2020


---
 .../gui/qt/medialibrary/qml/MainDisplay.qml   | 42 ++++++++++++++++++-
 1 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/MainDisplay.qml b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
index f5e4d8ee5c..4929f45709 100644
--- a/modules/gui/qt/medialibrary/qml/MainDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
@@ -208,8 +208,46 @@ Widgets.NavigableFocusScope {
                     PL.PlaylistListView {
                         id: playlist
                         focus: true
-                        width: root.width/4
-                        visible: mainInterface.playlistDocked && mainInterface.playlistVisible
+                        width: root.width / 4
+                        visible: false
+
+                        property bool expanded: mainInterface.playlistDocked && mainInterface.playlistVisible
+
+                        onExpandedChanged: {
+                            if (expanded) {
+                                animateExpand.start()
+                            }
+                            else {
+                                animateRetract.start()
+                            }
+                        }
+
+                        PropertyAnimation {
+                            id: animateExpand;
+                            easing.type: Easing.InSine
+                            target: playlist;
+                            properties: "width"
+                            duration: 150
+                            from: 0
+                            to: root.width / 4
+                            onStarted: {
+                                playlist.visible = true
+                            }
+                        }
+
+                        PropertyAnimation {
+                            id: animateRetract;
+                            easing.type: Easing.OutSine
+                            target: playlist;
+                            properties: "width"
+                            duration: 150
+                            from: root.width / 4
+                            to: 0
+                            onStopped: {
+                                playlist.visible = false
+                            }
+                        }
+
                         anchors {
                             top: parent.top
                             right: parent.right
-- 
2.25.1



More information about the vlc-devel mailing list