ToolboxFooter.qml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. color: UM.Theme.getColor("text")
  17. height: Math.floor(UM.Theme.getSize("toolbox_footer_button").height)
  18. verticalAlignment: Text.AlignVCenter
  19. anchors
  20. {
  21. top: restartButton.top
  22. left: parent.left
  23. leftMargin: UM.Theme.getSize("wide_margin").width
  24. right: restartButton.right
  25. rightMargin: UM.Theme.getSize("default_margin").width
  26. }
  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. }