From 7926a2bbdcc781f857029c56612890fb2cd8beda Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 16:33:52 +0100 Subject: [PATCH] Add placeholders for material & plugin icons CURA-8762 --- .../Marketplace/resources/images/Plugin.svg | 3 +++ .../Marketplace/resources/images/Spool.svg | 3 +++ .../resources/qml/PackageCardHeader.qml | 20 +++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 plugins/Marketplace/resources/images/Plugin.svg create mode 100644 plugins/Marketplace/resources/images/Spool.svg diff --git a/plugins/Marketplace/resources/images/Plugin.svg b/plugins/Marketplace/resources/images/Plugin.svg new file mode 100644 index 0000000000..51356d842c --- /dev/null +++ b/plugins/Marketplace/resources/images/Plugin.svg @@ -0,0 +1,3 @@ + + + diff --git a/plugins/Marketplace/resources/images/Spool.svg b/plugins/Marketplace/resources/images/Spool.svg new file mode 100644 index 0000000000..dae9b43030 --- /dev/null +++ b/plugins/Marketplace/resources/images/Spool.svg @@ -0,0 +1,3 @@ + + + diff --git a/plugins/Marketplace/resources/qml/PackageCardHeader.qml b/plugins/Marketplace/resources/qml/PackageCardHeader.qml index d6289f8ce1..ed5cce8485 100644 --- a/plugins/Marketplace/resources/qml/PackageCardHeader.qml +++ b/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