[vlc-commits] qml: use RoundImage in artist view rather than local implementation

Pierre Lamot git at videolan.org
Fri Jan 10 15:06:57 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Jan  3 10:15:13 2020 +0100| [e325ad646d3082daa597adcf8fcf86242a55e028] | committer: Jean-Baptiste Kempf

qml: use RoundImage in artist view rather than local implementation

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 .../gui/qt/medialibrary/qml/ArtistTopBanner.qml    | 25 +++-------------------
 .../qt/medialibrary/qml/MusicArtistsDisplay.qml    | 17 ++++++---------
 2 files changed, 9 insertions(+), 33 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml b/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
index dc92fbc810..a2423c3c5a 100644
--- a/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
+++ b/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
@@ -67,36 +67,17 @@ Widgets.NavigableFocusScope {
             Layout.leftMargin: VLCStyle.margin_small
             Layout.rightMargin: VLCStyle.margin_small
 
-            Rectangle {
-                id: artistImageContainer
-                color: VLCStyle.colors.banner
-
+            Widgets.RoundImage {
+                source: artist.cover || VLCStyle.noArtArtist
                 height: VLCStyle.cover_xsmall
                 width: VLCStyle.cover_xsmall
+                radius: VLCStyle.cover_xsmall
 
                 Layout.alignment: Qt.AlignVCenter
                 Layout.preferredHeight: VLCStyle.cover_small
                 Layout.preferredWidth: VLCStyle.cover_small
-
-                Image {
-                    id: artistImage
-                    source: artist.cover || VLCStyle.noArtArtist
-                    fillMode: Image.PreserveAspectCrop
-                    anchors.fill: parent
-                }
-
-                layer.enabled: true
-                layer.effect: OpacityMask {
-                    maskSource: Rectangle {
-                        width: VLCStyle.cover_small
-                        height: VLCStyle.cover_small
-                        radius: VLCStyle.cover_small
-                    }
-                }
             }
 
-
-
             Text {
                 id: artistName
                 text: artist.name || i18n.qtr("No artist")
diff --git a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
index 5f91b2df4f..5162489328 100644
--- a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
@@ -51,18 +51,13 @@ Widgets.NavigableFocusScope {
 
             color: VLCStyle.colors.getBgColor(delegateModel.inSelected, this.hovered, this.activeFocus)
 
-            cover: Rectangle {
-                color: VLCStyle.colors.banner
-                width: cover_obj.width
-
-                Image {
-                    id: cover_obj
-                    anchors.fill: parent
-
-                    fillMode: Image.PreserveAspectFit
-                    source: model.cover || VLCStyle.noArtArtistSmall
-                }
+            cover: Widgets.RoundImage {
+                source: model.cover || VLCStyle.noArtArtistSmall
+                height: VLCStyle.icon_normal
+                width: VLCStyle.icon_normal
+                radius: VLCStyle.icon_normal
             }
+
             line1: model.name || i18n.qtr("Unknown artist")
 
             actionButtons: []



More information about the vlc-commits mailing list