[vlc-devel] [PATCH 3/5] qml: bind miniplayer implicitHeigth after its animation so it can follow rescale

Pierre Lamot pierre at videolabs.io
Tue Sep 1 18:33:29 CEST 2020


---
 modules/gui/qt/player/qml/MiniPlayer.qml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/player/qml/MiniPlayer.qml b/modules/gui/qt/player/qml/MiniPlayer.qml
index 377dee6260..760002f7dc 100644
--- a/modules/gui/qt/player/qml/MiniPlayer.qml
+++ b/modules/gui/qt/player/qml/MiniPlayer.qml
@@ -19,7 +19,7 @@ Widgets.NavigableFocusScope {
 
     Component.onCompleted: {
         if (player.playingState !== PlayerController.PLAYING_STATE_STOPPED)
-            root.implicitHeight = VLCStyle.miniPlayerHeight
+            root.implicitHeight = Qt.binding(function() { return VLCStyle.miniPlayerHeight; })
     }
 
     Connections {
@@ -39,6 +39,9 @@ Widgets.NavigableFocusScope {
         duration: 200
         easing.type: Easing.InSine
         to: VLCStyle.miniPlayerHeight
+        onStopped: {
+            root.implicitHeight = Qt.binding(function() { return VLCStyle.miniPlayerHeight; })
+        }
     }
 
     PropertyAnimation {
@@ -48,6 +51,9 @@ Widgets.NavigableFocusScope {
         duration: 200
         easing.type: Easing.OutSine
         to: 0
+        onStopped: {
+            root.implicitHeight = 0
+        }
     }
 
     // this MouseArea prevents mouse events to be sent below miniplayer
-- 
2.25.1



More information about the vlc-devel mailing list