[vlc-commits] qml: add shadow to miniplayer cover

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


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

qml: add shadow to miniplayer cover

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

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

 modules/gui/qt/player/qml/MiniPlayer.qml | 37 +++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt/player/qml/MiniPlayer.qml b/modules/gui/qt/player/qml/MiniPlayer.qml
index 7ec5995733..708e44acd6 100644
--- a/modules/gui/qt/player/qml/MiniPlayer.qml
+++ b/modules/gui/qt/player/qml/MiniPlayer.qml
@@ -1,6 +1,7 @@
 import QtQuick 2.11
 import QtQuick.Controls 2.4
 import QtQuick.Layouts 1.3
+import QtGraphicalEffects 1.0
 
 import org.videolan.vlc 0.1
 
@@ -118,17 +119,37 @@ Widgets.NavigableFocusScope {
 
                         leftPadding: VLCStyle.margin_normal
 
-                        Image {
-                            id: cover
+                        Item {
                             anchors.verticalCenter: parent.verticalCenter
+                            implicitHeight: childrenRect.height
+                            implicitWidth:  childrenRect.width
 
-                            source: (mainPlaylistController.currentItem.artwork && mainPlaylistController.currentItem.artwork.toString())
-                                    ? mainPlaylistController.currentItem.artwork
-                                    : VLCStyle.noArtAlbum
-                            fillMode: Image.PreserveAspectFit
+                            Rectangle {
+                                id: coverRect
+                                anchors.fill: cover
+                                color: VLCStyle.colors.bg
+                            }
+
+                            DropShadow {
+                                anchors.fill: coverRect
+                                source: coverRect
+                                radius: 8
+                                samples: 17
+                                color: VLCStyle.colors.glowColorBanner
+                                spread: 0.2
+                            }
 
-                            width: VLCStyle.dp(60)
-                            height: VLCStyle.dp(60)
+                            Image {
+                                id: cover
+
+                                source: (mainPlaylistController.currentItem.artwork && mainPlaylistController.currentItem.artwork.toString())
+                                        ? mainPlaylistController.currentItem.artwork
+                                        : VLCStyle.noArtAlbum
+                                fillMode: Image.PreserveAspectFit
+
+                                width: VLCStyle.dp(60)
+                                height: VLCStyle.dp(60)
+                            }
                         }
 
                         Column {



More information about the vlc-commits mailing list