RecommendedPrintSetup.qml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // Copyright (c) 2023 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. Flickable
  10. {
  11. id: recommendedPrintSetup
  12. clip: true
  13. contentHeight: settingsColumn.height
  14. implicitHeight: settingsColumn.height
  15. property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1
  16. function onModeChanged() {}
  17. ScrollBar.vertical: UM.ScrollBar {
  18. id: scroll
  19. anchors
  20. {
  21. top: parent.top
  22. right: parent.right
  23. bottom: parent.bottom
  24. }
  25. }
  26. boundsBehavior: Flickable.StopAtBounds
  27. Column
  28. {
  29. id: settingsColumn
  30. padding: UM.Theme.getSize("default_margin").width
  31. spacing: UM.Theme.getSize("default_margin").height
  32. width: recommendedPrintSetup.width - 2 * padding - (scroll.visible ? scroll.width : 0)
  33. // TODO
  34. property real firstColumnWidth: Math.round(width / 3)
  35. UM.Label
  36. {
  37. text: catalog.i18nc("@label", "Profiles")
  38. font: UM.Theme.getFont("medium")
  39. }
  40. RecommendedQualityProfileSelector
  41. {
  42. width: parent.width
  43. hasQualityOptions: recommendedResolutionSelector.visible
  44. }
  45. RecommendedResolutionSelector
  46. {
  47. id: recommendedResolutionSelector
  48. width: parent.width
  49. }
  50. UnsupportedProfileIndication
  51. {
  52. width: parent.width
  53. visible: !recommendedResolutionSelector.visible
  54. }
  55. Item { height: UM.Theme.getSize("default_margin").height } // Spacer
  56. ProfileWarningReset
  57. {
  58. width: parent.width
  59. }
  60. Item { height: UM.Theme.getSize("thin_margin").height + UM.Theme.getSize("narrow_margin").height} // Spacer
  61. //Line between the sections.
  62. Rectangle
  63. {
  64. width: parent.width
  65. height: UM.Theme.getSize("default_lining").height
  66. color: UM.Theme.getColor("lining")
  67. }
  68. Item { height: UM.Theme.getSize("narrow_margin").height } //Spacer
  69. Column
  70. {
  71. id: settingColumn
  72. width: parent.width
  73. spacing: UM.Theme.getSize("thin_margin").height
  74. Item
  75. {
  76. id: recommendedPrintSettingsHeader
  77. height: childrenRect.height
  78. width: parent.width
  79. UM.Label
  80. {
  81. anchors.left: parent.left
  82. text: catalog.i18nc("@label", "Recommended print settings")
  83. font: UM.Theme.getFont("medium")
  84. }
  85. Cura.SecondaryButton
  86. {
  87. id: customSettingsButton
  88. anchors.right: parent.right
  89. text: catalog.i18nc("@button", "Show Custom")
  90. textFont: UM.Theme.getFont("medium_bold")
  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. }