[vlc-commits] qml: add play button icon change animation

Fatih Uzunoglu git at videolan.org
Thu Aug 27 12:45:01 CEST 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Aug  7 21:21:51 2020 +0300| [5ff058ab9751339c3742b33d6a7961b032029faf] | committer: Pierre Lamot

qml: add play button icon change animation

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

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

 modules/gui/qt/player/qml/ControlButtons.qml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/modules/gui/qt/player/qml/ControlButtons.qml b/modules/gui/qt/player/qml/ControlButtons.qml
index 0320849f6f..21ccbf78b5 100644
--- a/modules/gui/qt/player/qml/ControlButtons.qml
+++ b/modules/gui/qt/player/qml/ControlButtons.qml
@@ -161,6 +161,7 @@ Item{
             property bool realHovered: false
 
             contentItem: Label {
+                id: contentLabel
                 color: videoOverlays ? (playBtn.enabled ? playBtn.color : playBtn.colorDisabled)
                                      : (playBtn.enabled ? "#303030" : "#7f8c8d")
 
@@ -169,6 +170,28 @@ Item{
                       ? VLCIcons.pause
                       : VLCIcons.play
 
+                Behavior on text {
+                    SequentialAnimation {
+                        NumberAnimation {
+                            target: contentLabel
+                            property: "font.pixelSize"
+                            to: 0
+                            easing.type: Easing.OutSine
+                            duration: 75
+                        }
+
+                        PropertyAction { }
+
+                        NumberAnimation {
+                            target: contentLabel
+                            property: "font.pixelSize"
+                            to: VLCIcons.pixelSize(VLCStyle.icon_normal)
+                            easing.type: Easing.InSine
+                            duration: 75
+                        }
+                    }
+                }
+
                 font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_normal)
                 font.family: VLCIcons.fontFamily
 



More information about the vlc-commits mailing list