[vlc-commits] qml: hide slider handle within miniplayer when not hovered

Fatih Uzunoglu git at videolan.org
Thu Aug 27 12:44:39 CEST 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Tue Jul 28 18:20:03 2020 +0300| [cfb33b3489f8a48f08d94d9864de3c0728c4b867] | committer: Pierre Lamot

qml: hide slider handle within miniplayer when not hovered

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

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

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

diff --git a/modules/gui/qt/player/qml/SliderBar.qml b/modules/gui/qt/player/qml/SliderBar.qml
index 75e5a1563a..e3bee2d559 100644
--- a/modules/gui/qt/player/qml/SliderBar.qml
+++ b/modules/gui/qt/player/qml/SliderBar.qml
@@ -314,6 +314,8 @@ Slider {
     }
 
     handle: Rectangle {
+        id: sliderHandle
+
         visible: control.activeFocus
         x: (control.visualPosition * control.availableWidth) - width / 2
         y: (control.barHeight - width) / 2
@@ -321,5 +323,24 @@ Slider {
         implicitHeight: VLCStyle.margin_small
         radius: VLCStyle.margin_small
         color: VLCStyle.colors.accent
+
+        transitions: [
+            Transition {
+                to: "hidden"
+                SequentialAnimation {
+                    NumberAnimation { target: sliderHandle; properties: "implicitWidth,implicitHeight"; to: 0; duration: 150; easing.type: Easing.OutSine}
+                    PropertyAction { target: sliderHandle; property: "visible"; value: false; }
+                }
+            },
+            Transition {
+                to: "visible"
+                SequentialAnimation {
+                    PropertyAction { target: sliderHandle; property: "visible"; value: true; }
+                    NumberAnimation { target: sliderHandle; properties: "implicitWidth,implicitHeight"; to: VLCStyle.margin_small; duration: 150; easing.type: Easing.InSine}
+                }
+            }
+        ]
+
+        state: isMiniplayer ? (control.hovered ? "visible" : "hidden") : undefined
     }
 }



More information about the vlc-commits mailing list