From dd7168e8b80ae30dca1488c48a05aba2389f8f72 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 13 Jul 2018 13:41:19 +0200 Subject: [PATCH] CURA-5536 Add the installed check also to the featured items. --- .../qml/ToolboxDownloadsShowcaseTile.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index 561b2b4046..90829789e5 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -9,6 +9,8 @@ import UM 1.1 as UM Rectangle { + property int packageCount: toolbox.viewCategory == "material" ? model.package_count : 1 + property int installedPackages: toolbox.viewCategory == "material" ? toolbox.getNumberOfInstalledPackagesByAuthor(model.id) : (toolbox.isInstalled(model.id) ? 1 : 0) id: tileBase width: UM.Theme.getSize("toolbox_thumbnail_large").width + (2 * UM.Theme.getSize("default_lining").width) height: thumbnail.height + packageNameBackground.height + (2 * UM.Theme.getSize("default_lining").width) @@ -36,6 +38,22 @@ Rectangle source: model.icon_url || "../images/logobot.svg" mipmap: true } + UM.RecolorImage + { + width: (parent.width * 0.3) | 0 + height: (parent.height * 0.3) | 0 + anchors + { + bottom: parent.bottom + right: parent.right + bottomMargin: UM.Theme.getSize("default_lining").width + } + sourceSize.width: width + sourceSize.height: height + visible: installedPackages != 0 + color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") + source: "../images/installed_check.svg" + } } Rectangle {