[vlc-devel] [PATCH 20/21] qml: replace player solid background color with a blurred version of the cover

Pierre Lamot pierre at videolabs.io
Wed Aug 7 15:52:26 CEST 2019


---
 modules/gui/qt/qml/player/Player.qml | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/modules/gui/qt/qml/player/Player.qml b/modules/gui/qt/qml/player/Player.qml
index 839e69c9cc..d3ebac888b 100644
--- a/modules/gui/qt/qml/player/Player.qml
+++ b/modules/gui/qt/qml/player/Player.qml
@@ -39,6 +39,23 @@ Utils.NavigableFocusScope {
         color: VLCStyle.colors.bg
         anchors.fill: parent
 
+        FastBlur {
+            //destination aspect ration
+            readonly property real dar: parent.width / parent.height
+
+            anchors.centerIn: parent
+            width: (cover.sar < dar) ? parent.width :  parent.height * cover.sar
+            height: (cover.sar < dar) ? parent.width / cover.sar :  parent.height
+            source: cover
+            radius: 64
+
+            //darken background
+            Rectangle {
+                color: "#80000000"
+                anchors.fill: parent
+            }
+        }
+
         Image {
             id: cover
             source: (mainPlaylistController.currentItem.artwork && mainPlaylistController.currentItem.artwork.toString())
-- 
2.17.1



More information about the vlc-devel mailing list