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:
Jaime van Kessel 2019-03-27 13:21:56 +01:00
parent 1e02a20745
commit 56f3226ac1
2 changed files with 38 additions and 0 deletions

View File

@ -117,6 +117,42 @@ Item
rightMargin: UM.Theme.getSize("default_margin").width rightMargin: UM.Theme.getSize("default_margin").width
verticalCenter: parent.verticalCenter 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 AccountWidget

View File

@ -189,6 +189,8 @@
"toolbar_background": [255, 255, 255, 255], "toolbar_background": [255, 255, 255, 255],
"notification_icon": [255, 0, 0, 255],
"printer_type_label_background": [228, 228, 242, 255], "printer_type_label_background": [228, 228, 242, 255],
"text": [25, 25, 25, 255], "text": [25, 25, 25, 255],