[vlc-devel] [PATCH 30/38] qml: add play button icon change animation

Fatih Uzunoglu fuzun54 at outlook.com
Thu Aug 20 19:55:39 CEST 2020


---
 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
 
-- 
2.25.1



More information about the vlc-devel mailing list