[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: show fallback image if media cover is not available in PlaylistDelegate

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Aug 16 12:09:14 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
75f95790 by Prince Gupta at 2024-08-16T11:55:34+00:00
qml: show fallback image if media cover is not available in PlaylistDelegate

- - - - -
380feb81 by Prince Gupta at 2024-08-16T11:55:34+00:00
qml: show fallback image if media cover is not available in ArtworkInfoWidget

- - - - -


2 changed files:

- modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
- modules/gui/qt/playlist/qml/PlaylistDelegate.qml


Changes:

=====================================
modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
=====================================
@@ -142,7 +142,7 @@ AbstractButton {
     contentItem: RowLayout {
         spacing: VLCStyle.margin_xsmall
 
-        Image {
+        Widgets.MediaCover {
             id: coverImage
 
             Layout.fillHeight: true
@@ -152,14 +152,15 @@ AbstractButton {
                 if (!paintOnly && Player.artwork && Player.artwork.toString())
                     return VLCAccessImage.uri(Player.artwork)
                 else
-                    return VLCStyle.noArtAlbumCover
+                    return ""
             }
 
-            sourceSize.height: root.height * MainCtx.screen.devicePixelRatio
+            fallbackImageSource: VLCStyle.noArtAlbumCover
 
-            fillMode: Image.PreserveAspectFit
+            playCoverShowPlay: false
 
-            asynchronous: true
+            pictureWidth: root.width
+            pictureHeight: root.height
 
             Accessible.role: Accessible.Graphic
             Accessible.name: qsTr("Cover")
@@ -175,7 +176,6 @@ AbstractButton {
                 anchors.centerIn: coverImage
 
                 sourceItem: coverImage
-
             }
         }
 


=====================================
modules/gui/qt/playlist/qml/PlaylistDelegate.qml
=====================================
@@ -162,14 +162,16 @@ T.Control {
                 return qsTr("Media cover")
             }
 
-            Widgets.ScaledImage {
+            Widgets.MediaCover {
                 id: artwork
 
                 anchors.fill: parent
-                fillMode: Image.PreserveAspectFit
-                source: (model?.artwork.toString()) ? VLCAccessImage.uri(model.artwork) : VLCStyle.noArtAlbumCover
+                source: model.artwork ?? ""
+                fallbackImageSource: VLCStyle.noArtAlbumCover
                 visible: !statusIcon.visible
-                asynchronous: true
+                pictureWidth: parent.width
+                pictureHeight: parent.height
+                playCoverShowPlay: false
 
                 Widgets.DefaultShadow {
                     anchors.centerIn: parent



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/49fadff8a2dc68a2112ce0e84e6a8be9b74fe55e...380feb815e02a580ec6f9a7bdab900b023e867d7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/49fadff8a2dc68a2112ce0e84e6a8be9b74fe55e...380feb815e02a580ec6f9a7bdab900b023e867d7
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list