[vlc-devel] [PATCH 08/33] QML: use a specific icon for no art in the artist view

Adrien Maglo magsoft at videolan.org
Wed Jun 12 14:01:15 CEST 2019


---
 modules/gui/qt/Makefile.am                    |  1 +
 modules/gui/qt/pixmaps/noart_artist.svg       | 95 +++++++++++++++++++
 .../gui/qt/qml/mediacenter/ArtistListView.qml |  2 +-
 .../qt/qml/mediacenter/ArtistTopBanner.qml    |  2 +-
 .../qml/mediacenter/MusicArtistsDisplay.qml   |  4 +-
 modules/gui/qt/qml/style/VLCStyle.qml         |  1 +
 modules/gui/qt/vlc.qrc                        |  1 +
 7 files changed, 102 insertions(+), 4 deletions(-)
 create mode 100644 modules/gui/qt/pixmaps/noart_artist.svg

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 15d605a72e..4b32a2241a 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -406,6 +406,7 @@ libqt_plugin_la_RES = \
 	gui/qt/pixmaps/noart-64.png \
 	gui/qt/pixmaps/noart.png \
 	gui/qt/pixmaps/noart_album.svg \
+	gui/qt/pixmaps/noart_artist.svg \
 	gui/qt/pixmaps/pause.svg \
 	gui/qt/pixmaps/play.svg \
 	gui/qt/pixmaps/playlist/add.svg \
diff --git a/modules/gui/qt/pixmaps/noart_artist.svg b/modules/gui/qt/pixmaps/noart_artist.svg
new file mode 100644
index 0000000000..f61fd4ac87
--- /dev/null
+++ b/modules/gui/qt/pixmaps/noart_artist.svg
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="96"
+   height="96"
+   viewBox="0 0 96 96"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.92.3 (2405546, 2018-03-11)"
+   sodipodi:docname="noart_artist.svg">
+  <defs
+     id="defs8" />
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1920"
+     inkscape:window-height="1026"
+     id="namedview6"
+     showgrid="false"
+     inkscape:zoom="1.7383042"
+     inkscape:cx="-227.48514"
+     inkscape:cy="59.50694"
+     inkscape:window-x="1920"
+     inkscape:window-y="25"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="layer1"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:snap-bbox="false"
+     inkscape:snap-global="true"
+     inkscape:snap-grids="true">
+    <sodipodi:guide
+       position="0,24.017661"
+       orientation="1,0"
+       id="guide2390"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="23.59322,0"
+       orientation="0,1"
+       id="guide2392"
+       inkscape:locked="false" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Master"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-384,-956.3622)"
+     style="display:inline">
+    <path
+       style="fill:none;stroke:#747474;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path818"
+       sodipodi:type="arc"
+       sodipodi:cx="-432"
+       sodipodi:cy="-1017.6071"
+       sodipodi:rx="12.027812"
+       sodipodi:ry="12.282049"
+       sodipodi:start="0"
+       sodipodi:end="3.1415927"
+       sodipodi:open="true"
+       d="m -419.97219,-1017.6071 a 12.027812,12.282049 0 0 1 -6.0139,10.6365 12.027812,12.282049 0 0 1 -12.02782,0 12.027812,12.282049 0 0 1 -6.0139,-10.6365"
+       transform="scale(-1)" />
+    <circle
+       style="fill:none;fill-opacity:1;stroke:#747474;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path828"
+       cx="432"
+       cy="998.66675"
+       r="6.5495257" />
+  </g>
+</svg>
diff --git a/modules/gui/qt/qml/mediacenter/ArtistListView.qml b/modules/gui/qt/qml/mediacenter/ArtistListView.qml
index ee0a3d9a6a..bb2ff5b3d2 100644
--- a/modules/gui/qt/qml/mediacenter/ArtistListView.qml
+++ b/modules/gui/qt/qml/mediacenter/ArtistListView.qml
@@ -33,7 +33,7 @@ ListView {
         cover: Image {
             id: cover_obj
             fillMode: Image.PreserveAspectFit
-            source: model.cover || VLCStyle.noArtCover
+            source: model.cover || VLCStyle.noArtArtist
         }
         line1: model.name || qsTr("Unknown artist")
 
diff --git a/modules/gui/qt/qml/mediacenter/ArtistTopBanner.qml b/modules/gui/qt/qml/mediacenter/ArtistTopBanner.qml
index c29e199fa9..c6ff8bbc34 100644
--- a/modules/gui/qt/qml/mediacenter/ArtistTopBanner.qml
+++ b/modules/gui/qt/qml/mediacenter/ArtistTopBanner.qml
@@ -35,7 +35,7 @@ Rectangle {
 
     Image {
         id: artistImage
-        source: artist.cover || VLCStyle.noArtCover
+        source: artist.cover || VLCStyle.noArtArtist
         fillMode: Image.PreserveAspectCrop
         height: VLCStyle.cover_small
         width: VLCStyle.cover_small
diff --git a/modules/gui/qt/qml/mediacenter/MusicArtistsDisplay.qml b/modules/gui/qt/qml/mediacenter/MusicArtistsDisplay.qml
index 041c202d62..cda97eda2f 100644
--- a/modules/gui/qt/qml/mediacenter/MusicArtistsDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MusicArtistsDisplay.qml
@@ -58,7 +58,7 @@ Utils.NavigableFocusScope {
                 cover: Image {
                     id: cover_obj
                     fillMode: Image.PreserveAspectFit
-                    source: model.cover || VLCStyle.noArtCover
+                    source: model.cover || VLCStyle.noArtArtist
                 }
                 line1: model.name || qsTr("Unknown artist")
 
@@ -88,7 +88,6 @@ Utils.NavigableFocusScope {
                 Package.name: "grid"
                 id: gridItem
 
-                image: VLCStyle.noArtCover
                 title: model.name || "Unknown Artist"
                 selected: element.DelegateModel.inSelected
 
@@ -127,6 +126,7 @@ Utils.NavigableFocusScope {
                 }
                 Component.onCompleted: {
                     multicover.grabToImage(function(result) {
+                        gridItem.sourceSize = undefined
                         gridItem.image = result.url
                         //multicover.destroy()
                     })
diff --git a/modules/gui/qt/qml/style/VLCStyle.qml b/modules/gui/qt/qml/style/VLCStyle.qml
index db4aa1c979..e746920a64 100644
--- a/modules/gui/qt/qml/style/VLCStyle.qml
+++ b/modules/gui/qt/qml/style/VLCStyle.qml
@@ -105,6 +105,7 @@ Item {
     //default arts
     property url noArtCover: "qrc:///noart.png";
     property url noArtAlbum: "qrc:///noart_album.svg";
+    property url noArtArtist: "qrc:///noart_artist.svg";
 
 
 }
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index 5145f62194..f4c5e475ee 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -98,6 +98,7 @@
         <file alias="menu.svg">pixmaps/menu.svg</file>
         <file alias="VLCIcons.ttf">pixmaps/VLCIcons.ttf</file>
         <file alias="noart_album.svg">pixmaps/noart_album.svg</file>
+        <file alias="noart_artist.svg">pixmaps/noart_artist.svg</file>
     </qresource>
     <qresource prefix="/prefsmenu">
         <file alias="cone_audio_64.png">pixmaps/prefs/spref_cone_Audio_64.png</file>
-- 
2.20.1



More information about the vlc-devel mailing list