Browse Source

Add placeholders for material & plugin icons

CURA-8762
Jaime van Kessel 3 years ago
parent
commit
7926a2bbdc

+ 3 - 0
plugins/Marketplace/resources/images/Plugin.svg

@@ -0,0 +1,3 @@
+<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M39 14V8H27V14H21V8H9V14H7C6.20435 14 5.44129 14.3161 4.87868 14.8787C4.31607 15.4413 4 16.2044 4 17V37C4 37.7956 4.31607 38.5587 4.87868 39.1213C5.44129 39.6839 6.20435 40 7 40H41C41.7957 40 42.5587 39.6839 43.1213 39.1213C43.6839 38.5587 44 37.7956 44 37V17C44 16.2044 43.6839 15.4413 43.1213 14.8787C42.5587 14.3161 41.7957 14 41 14H39ZM29 10H37V14H29V10ZM11 10H19V14H11V10ZM42 38H6V16H42V38Z" fill="#000E1A"/>
+</svg>

File diff suppressed because it is too large
+ 1 - 0
plugins/Marketplace/resources/images/Spool.svg


+ 18 - 2
plugins/Marketplace/resources/qml/PackageCardHeader.qml

@@ -32,8 +32,24 @@ Item
         }
         width: UM.Theme.getSize("card_icon").width
         height: width
-
-        source: packageData.iconUrl != "" ? packageData.iconUrl : "../images/placeholder.svg"
+        sourceSize.height: height
+        sourceSize.width: width
+        source:
+        {
+            if(packageData.iconUrl != "")
+            {
+                return packageData.iconUrl
+            }
+            if(packageData.packageType == "plugin")
+            {
+                return "../images/Plugin.svg"
+            }
+            if(packageData.packageType == "material")
+            {
+                return "../images/Spool.svg"
+            }
+            return "../images/placeholder.svg"
+        }
     }
 
     ColumnLayout

Some files were not shown because too many files changed in this diff