SidebarSimple.qml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // Copyright (c) 2015 Ultimaker B.V.
  2. // Cura is released under the terms of the AGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.1
  5. import QtQuick.Controls.Styles 1.1
  6. import QtQuick.Layouts 1.1
  7. import UM 1.0 as UM
  8. Item {
  9. id: base;
  10. anchors.fill: parent;
  11. anchors.leftMargin: UM.Theme.sizes.default_margin.width;
  12. anchors.rightMargin: UM.Theme.sizes.default_margin.width;
  13. property Action configureSettings;
  14. property variant minimumPrintTime: PrintInformation.minimumPrintTime;
  15. property variant maximumPrintTime: PrintInformation.maximumPrintTime;
  16. ColumnLayout {
  17. anchors.fill: parent;
  18. Item {
  19. Layout.fillWidth: true;
  20. Layout.preferredHeight: UM.Theme.sizes.section.height;
  21. Label {
  22. anchors.left: parent.left;
  23. anchors.verticalCenter: parent.verticalCenter;
  24. text: base.minimumPrintTime.valid ? base.minimumPrintTime.getDisplayString(UM.DurationFormat.Short) : "??:??";
  25. font: UM.Theme.fonts.timeslider_time;
  26. color: UM.Theme.colors.primary;
  27. }
  28. Label {
  29. anchors.centerIn: parent;
  30. text: {
  31. if (UM.Backend.progress < 0)
  32. {
  33. //: Sidebar configuration label
  34. return qsTr("No Model Loaded");
  35. }
  36. else if (!base.minimumPrintTime.valid || !base.maximumPrintTime.valid)
  37. {
  38. //: Sidebar configuration label
  39. return qsTr("Calculating...")
  40. }
  41. else
  42. {
  43. //: Sidebar configuration label
  44. return qsTr("Estimated Print Time");
  45. }
  46. }
  47. color: UM.Theme.colors.text;
  48. font: UM.Theme.fonts.default;
  49. }
  50. Label {
  51. anchors.right: parent.right;
  52. anchors.verticalCenter: parent.verticalCenter;
  53. text: base.maximumPrintTime.valid ? base.maximumPrintTime.getDisplayString(UM.DurationFormat.Short) : "??:??";
  54. font: UM.Theme.fonts.timeslider_time;
  55. color: UM.Theme.colors.primary;
  56. }
  57. }
  58. Slider {
  59. Layout.fillWidth: true;
  60. Layout.preferredHeight: UM.Theme.sizes.section.height;
  61. minimumValue: 0;
  62. maximumValue: 100;
  63. value: PrintInformation.timeQualityValue;
  64. onValueChanged: PrintInformation.setTimeQualityValue(value);
  65. style: UM.Theme.styles.slider;
  66. }
  67. Item {
  68. Layout.fillWidth: true;
  69. Layout.preferredHeight: UM.Theme.sizes.section.height;
  70. Label {
  71. anchors.left: parent.left;
  72. anchors.verticalCenter: parent.verticalCenter;
  73. //: Quality slider label
  74. text: qsTr("Minimum\nDraft");
  75. color: UM.Theme.colors.text;
  76. font: UM.Theme.fonts.default;
  77. }
  78. Label {
  79. anchors.right: parent.right;
  80. anchors.verticalCenter: parent.verticalCenter;
  81. //: Quality slider label
  82. text: qsTr("Maximum\nQuality");
  83. horizontalAlignment: Text.AlignRight;
  84. color: UM.Theme.colors.text;
  85. font: UM.Theme.fonts.default;
  86. }
  87. }
  88. CheckBox {
  89. Layout.fillWidth: true;
  90. Layout.preferredHeight: UM.Theme.sizes.section.height;
  91. //: Setting checkbox
  92. text: qsTr("Enable Support");
  93. style: UM.Theme.styles.checkbox;
  94. checked: Printer.getSettingValue("support_enable");
  95. onCheckedChanged: Printer.setSettingValue("support_enable", checked);
  96. }
  97. Item { Layout.fillWidth: true; Layout.fillHeight: true; }
  98. }
  99. }