NotificationIcon.qml 1009 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2019 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import UM 1.4 as UM
  6. //
  7. // A notification icon which is a circle with a number at the center, that can be used to indicate, for example, how
  8. // many new messages that are available.
  9. //
  10. Rectangle
  11. {
  12. id: notificationIcon
  13. color: UM.Theme.getColor("notification_icon")
  14. width: UM.Theme.getSize("notification_icon").width
  15. height: UM.Theme.getSize("notification_icon").height
  16. radius: (0.5 * width) | 0
  17. property alias labelText: notificationLabel.text
  18. property alias labelFont: notificationLabel.font
  19. Label
  20. {
  21. id: notificationLabel
  22. anchors.centerIn: parent
  23. anchors.fill: parent
  24. color: UM.Theme.getColor("primary_text")
  25. horizontalAlignment: Text.AlignHCenter
  26. verticalAlignment: Text.AlignVCenter
  27. font: UM.Theme.getFont("small")
  28. renderType: Text.NativeRendering
  29. }
  30. }