ManagePackagesButton.qml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (c) 2021 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import UM 1.5 as UM
  4. import Cura 1.6 as Cura
  5. import QtQuick 2.15
  6. import QtQuick.Controls 2.15
  7. TabButton
  8. {
  9. id: root
  10. width: UM.Theme.getSize("button_icon").width + UM.Theme.getSize("narrow_margin").width
  11. height: UM.Theme.getSize("button_icon").height
  12. hoverEnabled: true
  13. property color inactiveBackgroundColor : hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("detail_background")
  14. property color activeBackgroundColor : UM.Theme.getColor("main_background")
  15. leftInset: UM.Theme.getSize("narrow_margin").width
  16. background: Rectangle
  17. {
  18. color: parent.checked ? activeBackgroundColor : inactiveBackgroundColor
  19. border.color: parent.checked ? UM.Theme.getColor("detail_background") : "transparent"
  20. border.width: UM.Theme.getSize("thick_lining").width
  21. radius: Math.round(width * 0.5)
  22. }
  23. UM.ToolTip
  24. {
  25. id: tooltip
  26. tooltipText: catalog.i18nc("@info:tooltip", "Manage packages")
  27. visible: root.hovered
  28. }
  29. UM.ColorImage
  30. {
  31. id: icon
  32. width: UM.Theme.getSize("section_icon").width
  33. height: UM.Theme.getSize("section_icon").height
  34. color: UM.Theme.getColor("icon")
  35. source: UM.Theme.getIcon("Settings")
  36. anchors.horizontalCenter: parent.horizontalCenter
  37. anchors.horizontalCenterOffset: Math.round(UM.Theme.getSize("narrow_margin").width /2)
  38. anchors.verticalCenter: parent.verticalCenter
  39. }
  40. }