mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Add the notification icon for the marketplace.
This adds an icon to the top right of the marketplace button to indicate that there are plugins with pending updates. CURA-6151
This commit is contained in:
parent
1e02a20745
commit
56f3226ac1
2 changed files with 38 additions and 0 deletions
|
|
@ -117,6 +117,42 @@ Item
|
|||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: marketplaceNotificationIcon
|
||||
color: UM.Theme.getColor("notification_icon")
|
||||
width: marketplaceButton.height / 1.5
|
||||
height: width
|
||||
radius: 0.5 * width
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
rightMargin: -0.5 * width
|
||||
topMargin: -0.5 * height
|
||||
}
|
||||
visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0
|
||||
|
||||
Label
|
||||
{
|
||||
id: marketplaceNotificationText
|
||||
anchors.centerIn: parent
|
||||
anchors.fill: parent
|
||||
text:
|
||||
{
|
||||
if(CuraApplication.getPackageManager().packagesWithUpdate.length > 9)
|
||||
{
|
||||
return "9+" // More than 2 characters don't fit.
|
||||
}
|
||||
return CuraApplication.getPackageManager().packagesWithUpdate.length
|
||||
}
|
||||
color: UM.Theme.getColor("primary_text")
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font: UM.Theme.getFont("small")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AccountWidget
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue