[vlc-devel] [PATCH 20/38] qml: use frosted glass blur effect in miniplayer background

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


---
 modules/gui/qt/medialibrary/qml/MainDisplay.qml |  4 +++-
 modules/gui/qt/player/qml/MiniPlayer.qml        | 17 +++++++++++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/MainDisplay.qml b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
index c5753a813f..8bdd0fcbdc 100644
--- a/modules/gui/qt/medialibrary/qml/MainDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
@@ -147,7 +147,7 @@ Widgets.NavigableFocusScope {
             navigationParent: root
 
             ColumnLayout {
-                id: column
+                id: mainColumn
                 anchors.fill: parent
 
                 Layout.minimumWidth: VLCStyle.minWindowWidth
@@ -411,6 +411,8 @@ Widgets.NavigableFocusScope {
                     if (!expanded && miniPlayer.activeFocus)
                         stackView.forceActiveFocus()
                 }
+
+                mainContent: mainColumn
             }
         }
     }
diff --git a/modules/gui/qt/player/qml/MiniPlayer.qml b/modules/gui/qt/player/qml/MiniPlayer.qml
index c022f9a0a5..84d1f34dbd 100644
--- a/modules/gui/qt/player/qml/MiniPlayer.qml
+++ b/modules/gui/qt/player/qml/MiniPlayer.qml
@@ -15,6 +15,8 @@ Widgets.NavigableFocusScope {
 
     readonly property bool expanded: root.implicitHeight === root.childrenRect.height
 
+    property var mainContent: undefined
+
     Component.onCompleted : {
         if (player.playingState === PlayerController.PLAYING_STATE_STOPPED)
             root.implicitHeight = 0;
@@ -77,14 +79,25 @@ Widgets.NavigableFocusScope {
             }
         }
 
-        Rectangle {
+
+        Item {
+            id: mainRect
+
             anchors {
                 left: parent.left
                 right: parent.right
             }
             z: 0
             height: VLCStyle.miniPlayerHeight
-            color: VLCStyle.colors.banner
+
+            Widgets.FrostedGlassEffect {
+                anchors.fill: parent
+
+                source: mainContent
+                sourceRect: Qt.rect(root.x, root.y, root.width, root.height)
+
+                tint: VLCStyle.colors.blendColors(VLCStyle.colors.bg, VLCStyle.colors.banner, 0.85)
+            }
 
             RowLayout {
                 anchors {
-- 
2.25.1



More information about the vlc-devel mailing list