mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
Merge pull request #5521 from Ultimaker/CURA-6151-Notify-updates-from-marketplace
Notify updates from marketplace
This commit is contained in:
commit
b28e98f288
10 changed files with 135 additions and 60 deletions
|
|
@ -117,6 +117,25 @@ Item
|
|||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Cura.NotificationIcon
|
||||
{
|
||||
id: marketplaceNotificationIcon
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
rightMargin: (-0.5 * width) | 0
|
||||
topMargin: (-0.5 * height) | 0
|
||||
}
|
||||
visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0
|
||||
|
||||
labelText:
|
||||
{
|
||||
const itemCount = CuraApplication.getPackageManager().packagesWithUpdate.length
|
||||
return itemCount > 9 ? "9+" : itemCount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AccountWidget
|
||||
|
|
|
|||
35
resources/qml/Widgets/NotificationIcon.qml
Normal file
35
resources/qml/Widgets/NotificationIcon.qml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.4 as UM
|
||||
|
||||
|
||||
//
|
||||
// A notification icon which is a circle with a number at the center, that can be used to indicate, for example, how
|
||||
// many new messages that are available.
|
||||
//
|
||||
Rectangle
|
||||
{
|
||||
id: notificationIcon
|
||||
color: UM.Theme.getColor("notification_icon")
|
||||
width: UM.Theme.getSize("notification_icon").width
|
||||
height: UM.Theme.getSize("notification_icon").height
|
||||
radius: (0.5 * width) | 0
|
||||
|
||||
property alias labelText: notificationLabel.text
|
||||
property alias labelFont: notificationLabel.font
|
||||
|
||||
Label
|
||||
{
|
||||
id: notificationLabel
|
||||
anchors.centerIn: parent
|
||||
anchors.fill: parent
|
||||
color: UM.Theme.getColor("primary_text")
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font: UM.Theme.getFont("small")
|
||||
}
|
||||
}
|
||||
|
|
@ -17,3 +17,5 @@ SettingView 1.0 SettingView.qml
|
|||
ProfileMenu 1.0 ProfileMenu.qml
|
||||
CheckBoxWithTooltip 1.0 CheckBoxWithTooltip.qml
|
||||
ToolTip 1.0 ToolTip.qml
|
||||
|
||||
NotificationIcon 1.0 NotificationIcon.qml
|
||||
|
|
|
|||
|
|
@ -214,7 +214,6 @@
|
|||
|
||||
"toolbox_header_button_text_active": [255, 255, 255, 255],
|
||||
"toolbox_header_button_text_inactive": [128, 128, 128, 255],
|
||||
"toolbox_header_button_text_hovered": [255, 255, 255, 255],
|
||||
|
||||
"monitor_printer_family_tag": [86, 86, 106, 255],
|
||||
"monitor_text_primary": [229, 229, 229, 255],
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
@ -384,7 +386,6 @@
|
|||
|
||||
"toolbox_header_button_text_active": [0, 0, 0, 255],
|
||||
"toolbox_header_button_text_inactive": [0, 0, 0, 255],
|
||||
"toolbox_header_button_text_hovered": [0, 0, 0, 255],
|
||||
|
||||
"favorites_header_bar": [245, 245, 245, 255],
|
||||
"favorites_header_hover": [245, 245, 245, 255],
|
||||
|
|
@ -595,6 +596,8 @@
|
|||
"toolbox_action_button": [8.0, 2.5],
|
||||
"toolbox_loader": [2.0, 2.0],
|
||||
|
||||
"notification_icon": [1.4, 1.4],
|
||||
|
||||
"avatar_image": [6.8, 6.8],
|
||||
|
||||
"monitor_config_override_box": [1.0, 14.0],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue