[vlc-commits] qml: add animation to MainDisplay playlist

Fatih Uzunoglu git at videolan.org
Fri Jul 3 14:59:09 CEST 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Thu Jun 25 01:11:20 2020 +0300| [21dc12c7ddaec4f4954d2ff7b1d46eb213dd29db] | committer: Pierre Lamot

qml: add animation to MainDisplay playlist

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

 modules/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



More information about the vlc-commits mailing list