mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 04:26:05 +08: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
@ -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
|
||||
|
@ -189,6 +189,8 @@
|
||||
|
||||
"toolbar_background": [255, 255, 255, 255],
|
||||
|
||||
"notification_icon": [255, 0, 0, 255],
|
||||
|
||||
"printer_type_label_background": [228, 228, 242, 255],
|
||||
|
||||
"text": [25, 25, 25, 255],
|
||||
|
Loading…
x
Reference in New Issue
Block a user