ConfigUI.qml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. // Copyright (c) 2022 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.1
  4. import QtQuick.Controls 1.1 as OldControls
  5. import QtQuick.Controls 2.15
  6. import QtQuick.Layouts 1.1
  7. import QtQuick.Window 2.1
  8. import UM 1.1 as UM
  9. UM.Dialog
  10. {
  11. width: minimumWidth;
  12. minimumWidth: 350 * screenScaleFactor;
  13. height: minimumHeight;
  14. minimumHeight: 250 * screenScaleFactor;
  15. title: catalog.i18nc("@title:window", "Convert Image...")
  16. GridLayout
  17. {
  18. UM.I18nCatalog{id: catalog; name: "cura"}
  19. anchors.fill: parent;
  20. Layout.fillWidth: true
  21. columnSpacing: 16 * screenScaleFactor
  22. rowSpacing: 4 * screenScaleFactor
  23. columns: 1
  24. UM.TooltipArea
  25. {
  26. Layout.fillWidth:true
  27. height: childrenRect.height
  28. text: catalog.i18nc("@info:tooltip","The maximum distance of each pixel from \"Base.\"")
  29. Row
  30. {
  31. width: parent.width
  32. Label
  33. {
  34. text: catalog.i18nc("@action:label", "Height (mm)")
  35. width: 150 * screenScaleFactor
  36. anchors.verticalCenter: parent.verticalCenter
  37. }
  38. OldControls.TextField
  39. {
  40. id: peak_height
  41. objectName: "Peak_Height"
  42. validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/}
  43. width: 180 * screenScaleFactor
  44. onTextChanged: { manager.onPeakHeightChanged(text) }
  45. }
  46. }
  47. }
  48. UM.TooltipArea
  49. {
  50. Layout.fillWidth:true
  51. height: childrenRect.height
  52. text: catalog.i18nc("@info:tooltip","The base height from the build plate in millimeters.")
  53. Row
  54. {
  55. width: parent.width
  56. Label
  57. {
  58. text: catalog.i18nc("@action:label", "Base (mm)")
  59. width: 150 * screenScaleFactor
  60. anchors.verticalCenter: parent.verticalCenter
  61. }
  62. OldControls.TextField
  63. {
  64. id: base_height
  65. objectName: "Base_Height"
  66. validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/}
  67. width: 180 * screenScaleFactor
  68. onTextChanged: { manager.onBaseHeightChanged(text) }
  69. }
  70. }
  71. }
  72. UM.TooltipArea
  73. {
  74. Layout.fillWidth:true
  75. height: childrenRect.height
  76. text: catalog.i18nc("@info:tooltip","The width in millimeters on the build plate.")
  77. Row
  78. {
  79. width: parent.width
  80. Label
  81. {
  82. text: catalog.i18nc("@action:label", "Width (mm)")
  83. width: 150 * screenScaleFactor
  84. anchors.verticalCenter: parent.verticalCenter
  85. }
  86. OldControls.TextField
  87. {
  88. id: width
  89. objectName: "Width"
  90. focus: true
  91. validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
  92. width: 180 * screenScaleFactor
  93. onTextChanged: { manager.onWidthChanged(text) }
  94. }
  95. }
  96. }
  97. UM.TooltipArea
  98. {
  99. Layout.fillWidth:true
  100. height: childrenRect.height
  101. text: catalog.i18nc("@info:tooltip","The depth in millimeters on the build plate")
  102. Row
  103. {
  104. width: parent.width
  105. Label
  106. {
  107. text: catalog.i18nc("@action:label", "Depth (mm)")
  108. width: 150 * screenScaleFactor
  109. anchors.verticalCenter: parent.verticalCenter
  110. }
  111. OldControls.TextField
  112. {
  113. id: depth
  114. objectName: "Depth"
  115. focus: true
  116. validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
  117. width: 180 * screenScaleFactor
  118. onTextChanged: { manager.onDepthChanged(text) }
  119. }
  120. }
  121. }
  122. UM.TooltipArea
  123. {
  124. Layout.fillWidth:true
  125. height: childrenRect.height
  126. text: catalog.i18nc("@info:tooltip","For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.")
  127. Row
  128. {
  129. width: parent.width
  130. //Empty label so 2 column layout works.
  131. Label
  132. {
  133. text: ""
  134. width: 150 * screenScaleFactor
  135. anchors.verticalCenter: parent.verticalCenter
  136. }
  137. OldControls.ComboBox
  138. {
  139. id: lighter_is_higher
  140. objectName: "Lighter_Is_Higher"
  141. model: [ catalog.i18nc("@item:inlistbox","Darker is higher"), catalog.i18nc("@item:inlistbox","Lighter is higher") ]
  142. width: 180 * screenScaleFactor
  143. onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) }
  144. }
  145. }
  146. }
  147. UM.TooltipArea
  148. {
  149. Layout.fillWidth:true
  150. height: childrenRect.height
  151. text: catalog.i18nc("@info:tooltip","For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.")
  152. Row
  153. {
  154. width: parent.width
  155. Label
  156. {
  157. text: "Color Model"
  158. width: 150 * screenScaleFactor
  159. anchors.verticalCenter: parent.verticalCenter
  160. }
  161. OldControls.ComboBox
  162. {
  163. id: color_model
  164. objectName: "ColorModel"
  165. model: [ catalog.i18nc("@item:inlistbox","Linear"), catalog.i18nc("@item:inlistbox","Translucency") ]
  166. width: 180 * screenScaleFactor
  167. onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) }
  168. }
  169. }
  170. }
  171. UM.TooltipArea
  172. {
  173. Layout.fillWidth:true
  174. height: childrenRect.height
  175. text: catalog.i18nc("@info:tooltip","The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.")
  176. visible: color_model.currentText == catalog.i18nc("@item:inlistbox","Translucency")
  177. Row
  178. {
  179. width: parent.width
  180. Label
  181. {
  182. text: catalog.i18nc("@action:label", "1mm Transmittance (%)")
  183. width: 150 * screenScaleFactor
  184. anchors.verticalCenter: parent.verticalCenter
  185. }
  186. OldControls.TextField
  187. {
  188. id: transmittance
  189. objectName: "Transmittance"
  190. focus: true
  191. validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
  192. width: 180 * screenScaleFactor
  193. onTextChanged: { manager.onTransmittanceChanged(text) }
  194. }
  195. }
  196. }
  197. UM.TooltipArea
  198. {
  199. Layout.fillWidth:true
  200. height: childrenRect.height
  201. text: catalog.i18nc("@info:tooltip","The amount of smoothing to apply to the image.")
  202. Row
  203. {
  204. width: parent.width
  205. Label
  206. {
  207. text: catalog.i18nc("@action:label", "Smoothing")
  208. width: 150 * screenScaleFactor
  209. anchors.verticalCenter: parent.verticalCenter
  210. }
  211. Item
  212. {
  213. width: 180 * screenScaleFactor
  214. height: 20 * screenScaleFactor
  215. Layout.fillWidth: true
  216. Slider
  217. {
  218. id: smoothing
  219. objectName: "Smoothing"
  220. from: 0.0
  221. to: 100.0
  222. stepSize: 1.0
  223. width: 180
  224. onValueChanged: { manager.onSmoothingChanged(value) }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. rightButtons: [
  231. OldControls.Button
  232. {
  233. id:ok_button
  234. text: catalog.i18nc("@action:button","OK");
  235. onClicked: { manager.onOkButtonClicked() }
  236. enabled: true
  237. },
  238. OldControls.Button
  239. {
  240. id:cancel_button
  241. text: catalog.i18nc("@action:button","Cancel");
  242. onClicked: { manager.onCancelButtonClicked() }
  243. enabled: true
  244. }
  245. ]
  246. }