mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-05 14:15:10 +08:00
Cleanup gridTile
CURA-6013
This commit is contained in:
parent
fed9e2b623
commit
4742db6fec
@ -13,20 +13,9 @@ Item
|
||||
id: toolboxDownloadsGridTile
|
||||
property int packageCount: (toolbox.viewCategory == "material" && model.type === undefined) ? toolbox.getTotalNumberOfMaterialPackagesByAuthor(model.id) : 1
|
||||
property int installedPackages: (toolbox.viewCategory == "material" && model.type === undefined) ? toolbox.getNumberOfInstalledPackagesByAuthor(model.id) : (toolbox.isInstalled(model.id) ? 1 : 0)
|
||||
height: childrenRect.height
|
||||
height: UM.Theme.getSize("toolbox_thumbnail_small").height
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
||||
Rectangle
|
||||
{
|
||||
id: highlight
|
||||
anchors.fill: parent
|
||||
opacity: 0.0
|
||||
color: UM.Theme.getColor("primary")
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
spacing: Math.floor(UM.Theme.getSize("narrow_margin").width)
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: thumbnail
|
||||
@ -35,6 +24,7 @@ Item
|
||||
color: "white"
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
|
||||
Image
|
||||
{
|
||||
anchors.centerIn: parent
|
||||
@ -43,6 +33,8 @@ Item
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: model.icon_url || "../images/logobot.svg"
|
||||
mipmap: true
|
||||
|
||||
|
||||
}
|
||||
UM.RecolorImage
|
||||
{
|
||||
@ -95,18 +87,23 @@ Item
|
||||
}
|
||||
}
|
||||
}
|
||||
Column
|
||||
Item
|
||||
{
|
||||
width: parent.width - thumbnail.width - parent.spacing
|
||||
spacing: Math.floor(UM.Theme.getSize("narrow_margin").width)
|
||||
anchors.top: parent.top
|
||||
//anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors
|
||||
{
|
||||
left: thumbnail.right
|
||||
leftMargin: Math.floor(UM.Theme.getSize("narrow_margin").width)
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: name
|
||||
text: model.name
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
elide: Text.ElideRight
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
}
|
||||
@ -114,23 +111,25 @@ Item
|
||||
{
|
||||
id: info
|
||||
text: model.description
|
||||
maximumLineCount: 2
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors.top: name.bottom
|
||||
anchors.bottom: rating.top
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
RatingWidget
|
||||
{
|
||||
id: rating
|
||||
visible: model.type == "plugin"
|
||||
packageId: model.id
|
||||
rating: model.average_rating != undefined ? model.average_rating : 0
|
||||
numRatings: model.num_ratings != undefined ? model.num_ratings : 0
|
||||
userRating: model.user_rating
|
||||
enabled: installedPackages != 0 && Cura.API.account.isLoggedIn
|
||||
}
|
||||
anchors.bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user