mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 17:49:01 +08:00
CURA-5536 Set different colors indicating that all the inner packages
are installed of just some.
This commit is contained in:
parent
96cc1be2ff
commit
62b1d361fa
@ -9,6 +9,8 @@ import UM 1.1 as UM
|
|||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
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)
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
||||||
Rectangle
|
Rectangle
|
||||||
@ -51,8 +53,8 @@ Item
|
|||||||
}
|
}
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: height
|
sourceSize.height: height
|
||||||
visible: toolbox.isInstalled(model.id)
|
visible: installedPackages != 0
|
||||||
color: UM.Theme.getColor("primary")
|
color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border")
|
||||||
source: "../images/installed_check.svg"
|
source: "../images/installed_check.svg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,7 +65,7 @@ Item
|
|||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: name
|
id: name
|
||||||
text: toolbox.viewCategory == "material" ? model.name + " (" + toolbox.getNumberOfInstalledPackagesByAuthor(model.id) + "/" + model.package_count + ")" : model.name
|
text: model.name
|
||||||
width: parent.width
|
width: parent.width
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user