RecommendedPrintSetup.qml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // Copyright (c) 2022 UltiMaker
  2. //Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.15
  5. import QtQuick.Layouts 1.1
  6. import UM 1.6 as UM
  7. import Cura 1.6 as Cura
  8. import ".."
  9. ScrollView
  10. {
  11. id: recommendedPrintSetup
  12. implicitHeight: settingsColumn.height + 2 * padding
  13. property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1
  14. padding: UM.Theme.getSize("default_margin").width
  15. function onModeChanged() {}
  16. ScrollBar.vertical: UM.ScrollBar {
  17. id: scroll
  18. anchors
  19. {
  20. top: parent.top
  21. right: parent.right
  22. bottom: parent.bottom
  23. }
  24. }
  25. Column
  26. {
  27. id: settingsColumn
  28. spacing: UM.Theme.getSize("default_margin").height
  29. width: recommendedPrintSetup.width - 2 * recommendedPrintSetup.padding - (scroll.visible ? scroll.width : 0)
  30. // TODO
  31. property real firstColumnWidth: Math.round(width / 3)
  32. UM.Label
  33. {
  34. text: catalog.i18nc("@label", "Profiles")
  35. font: UM.Theme.getFont("medium")
  36. }
  37. RecommendedQualityProfileSelector
  38. {
  39. width: parent.width
  40. hasQualityOptions: recommendedResolutionSelector.visible
  41. }
  42. RecommendedResolutionSelector
  43. {
  44. id: recommendedResolutionSelector
  45. width: parent.width
  46. }
  47. UnsupportedProfileIndication
  48. {
  49. width: parent.width
  50. visible: !recommendedResolutionSelector.visible
  51. }
  52. Item { height: UM.Theme.getSize("default_margin").height } // Spacer
  53. ProfileWarningReset
  54. {
  55. width: parent.width
  56. }
  57. Item { height: UM.Theme.getSize("thin_margin").height + UM.Theme.getSize("narrow_margin").height} // Spacer
  58. //Line between the sections.
  59. Rectangle
  60. {
  61. width: parent.width
  62. height: UM.Theme.getSize("default_lining").height
  63. color: UM.Theme.getColor("lining")
  64. }
  65. Item { height: UM.Theme.getSize("narrow_margin").height } //Spacer
  66. Column
  67. {
  68. id: settingColumn
  69. width: parent.width
  70. spacing: UM.Theme.getSize("thin_margin").height
  71. Item
  72. {
  73. id: recommendedPrintSettingsHeader
  74. height: childrenRect.height
  75. width: parent.width
  76. UM.Label
  77. {
  78. anchors.verticalCenter: parent.verticalCenter
  79. anchors.left: parent.left
  80. text: catalog.i18nc("@label", "Recommended print settings")
  81. font: UM.Theme.getFont("medium")
  82. }
  83. Cura.SecondaryButton
  84. {
  85. id: customSettingsButton
  86. anchors.verticalCenter: parent.verticalCenter
  87. anchors.right: parent.right
  88. text: catalog.i18nc("@button", "Show Custom")
  89. textFont: UM.Theme.getFont("medium_bold")
  90. outlineColor: "transparent"
  91. onClicked: onModeChanged()
  92. }
  93. }
  94. RecommendedStrengthSelector
  95. {
  96. width: parent.width
  97. }
  98. RecommendedSupportSelector
  99. {
  100. width: parent.width
  101. }
  102. RecommendedAdhesionSelector
  103. {
  104. width: parent.width
  105. }
  106. }
  107. }
  108. UM.SettingPropertyProvider
  109. {
  110. id: extrudersEnabledCount
  111. containerStack: Cura.MachineManager.activeMachine
  112. key: "extruders_enabled_count"
  113. watchedProperties: [ "value" ]
  114. storeIndex: 0
  115. }
  116. }