ToolboxFooter.qml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.4
  5. import QtQuick.Controls.Styles 1.4
  6. import UM 1.1 as UM
  7. Item
  8. {
  9. id: footer
  10. width: parent.width
  11. anchors.bottom: parent.bottom
  12. height: visible ? Math.floor(UM.Theme.getSize("toolbox_footer").height) : 0
  13. Label
  14. {
  15. text: catalog.i18nc("@info", "You will need to restart Cura before changes in packages have effect.")
  16. height: Math.floor(UM.Theme.getSize("toolbox_footer_button").height)
  17. verticalAlignment: Text.AlignVCenter
  18. anchors
  19. {
  20. top: restartButton.top
  21. left: parent.left
  22. leftMargin: UM.Theme.getSize("wide_margin").width
  23. right: restartButton.right
  24. rightMargin: UM.Theme.getSize("default_margin").width
  25. }
  26. }
  27. Button
  28. {
  29. id: restartButton
  30. text: catalog.i18nc("@info:button", "Quit Cura")
  31. anchors
  32. {
  33. top: parent.top
  34. topMargin: UM.Theme.getSize("default_margin").height
  35. right: parent.right
  36. rightMargin: UM.Theme.getSize("wide_margin").width
  37. }
  38. iconName: "dialog-restart"
  39. onClicked: toolbox.restart()
  40. style: ButtonStyle
  41. {
  42. background: Rectangle
  43. {
  44. implicitWidth: UM.Theme.getSize("toolbox_footer_button").width
  45. implicitHeight: Math.floor(UM.Theme.getSize("toolbox_footer_button").height)
  46. color: control.hovered ? UM.Theme.getColor("primary_hover") : UM.Theme.getColor("primary")
  47. }
  48. label: Label
  49. {
  50. color: UM.Theme.getColor("button_text")
  51. font: UM.Theme.getFont("default_bold")
  52. text: control.text
  53. verticalAlignment: Text.AlignVCenter
  54. horizontalAlignment: Text.AlignHCenter
  55. }
  56. }
  57. }
  58. ToolboxShadow
  59. {
  60. visible: footer.visible
  61. anchors.bottom: footer.top
  62. reversed: true
  63. }
  64. }