ToolboxRestartDialog.qml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // PluginBrowser is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Dialogs 1.1
  5. import QtQuick.Window 2.2
  6. import QtQuick.Controls 1.4
  7. import QtQuick.Controls.Styles 1.4
  8. // TODO: Switch to QtQuick.Controls 2.x and remove QtQuick.Controls.Styles
  9. import UM 1.1 as UM
  10. Window {
  11. // title: catalog.i18nc("@title:tab", "Plugins");
  12. width: 360 * screenScaleFactor
  13. height: 120 * screenScaleFactor
  14. minimumWidth: 360 * screenScaleFactor
  15. minimumHeight: 120 * screenScaleFactor
  16. color: UM.Theme.getColor("sidebar")
  17. property var message;
  18. Text {
  19. id: message
  20. anchors {
  21. left: parent.left
  22. leftMargin: UM.Theme.getSize("default_margin").width
  23. top: parent.top
  24. topMargin: UM.Theme.getSize("default_margin").height
  25. }
  26. text: restartDialog.message != null ? restartDialog.message : ""
  27. }
  28. Button {
  29. id: laterButton
  30. text: "Later"
  31. onClicked: restartDialog.close();
  32. anchors {
  33. left: parent.left
  34. leftMargin: UM.Theme.getSize("default_margin").width
  35. bottom: parent.bottom
  36. bottomMargin: UM.Theme.getSize("default_margin").height
  37. }
  38. style: ButtonStyle {
  39. background: Rectangle {
  40. color: "transparent"
  41. implicitWidth: 96
  42. implicitHeight: 30
  43. border {
  44. width: 1
  45. color: UM.Theme.getColor("lining")
  46. }
  47. }
  48. label: Text {
  49. verticalAlignment: Text.AlignVCenter
  50. color: UM.Theme.getColor("text")
  51. text: control.text
  52. horizontalAlignment: Text.AlignHCenter
  53. }
  54. }
  55. }
  56. Button {
  57. id: restartButton
  58. text: "Quit Cura"
  59. anchors {
  60. right: parent.right
  61. rightMargin: UM.Theme.getSize("default_margin").width
  62. bottom: parent.bottom
  63. bottomMargin: UM.Theme.getSize("default_margin").height
  64. }
  65. onClicked: manager.restart()
  66. style: ButtonStyle {
  67. background: Rectangle {
  68. implicitWidth: 96
  69. implicitHeight: 30
  70. color: UM.Theme.getColor("primary")
  71. }
  72. label: Text {
  73. verticalAlignment: Text.AlignVCenter
  74. color: UM.Theme.getColor("button_text")
  75. font {
  76. pixelSize: 13
  77. bold: true
  78. }
  79. text: control.text
  80. horizontalAlignment: Text.AlignHCenter
  81. }
  82. }
  83. }
  84. }