ToolboxFooter.qml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. color: UM.Theme.getColor("text")
  27. }
  28. Button
  29. {
  30. id: restartButton
  31. text: catalog.i18nc("@info:button", "Quit Cura")
  32. anchors
  33. {
  34. top: parent.top
  35. topMargin: UM.Theme.getSize("default_margin").height
  36. right: parent.right
  37. rightMargin: UM.Theme.getSize("wide_margin").width
  38. }
  39. iconName: "dialog-restart"
  40. onClicked: toolbox.restart()
  41. style: ButtonStyle
  42. {
  43. background: Rectangle
  44. {
  45. implicitWidth: UM.Theme.getSize("toolbox_footer_button").width
  46. implicitHeight: Math.floor(UM.Theme.getSize("toolbox_footer_button").height)
  47. color: control.hovered ? UM.Theme.getColor("primary_hover") : UM.Theme.getColor("primary")
  48. }
  49. label: Label
  50. {
  51. color: UM.Theme.getColor("button_text")
  52. font: UM.Theme.getFont("default_bold")
  53. text: control.text
  54. verticalAlignment: Text.AlignVCenter
  55. horizontalAlignment: Text.AlignHCenter
  56. }
  57. }
  58. }
  59. ToolboxShadow
  60. {
  61. visible: footer.visible
  62. anchors.bottom: footer.top
  63. reversed: true
  64. }
  65. }