ConfigUI.qml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. // Copyright (c) 2015 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
  5. import QtQuick.Layouts 1.1
  6. import QtQuick.Window 2.1
  7. import UM 1.1 as UM
  8. UM.Dialog
  9. {
  10. width: minimumWidth;
  11. minimumWidth: 350 * screenScaleFactor;
  12. height: minimumHeight;
  13. minimumHeight: 250 * screenScaleFactor;
  14. title: catalog.i18nc("@title:window", "Convert Image...")
  15. GridLayout
  16. {
  17. UM.I18nCatalog{id: catalog; name: "cura"}
  18. anchors.fill: parent;
  19. Layout.fillWidth: true
  20. columnSpacing: 16 * screenScaleFactor
  21. rowSpacing: 4 * screenScaleFactor
  22. columns: 1
  23. UM.TooltipArea {
  24. Layout.fillWidth:true
  25. height: childrenRect.height
  26. text: catalog.i18nc("@info:tooltip","The maximum distance of each pixel from \"Base.\"")
  27. Row {
  28. width: parent.width
  29. Label {
  30. text: catalog.i18nc("@action:label", "Height (mm)")
  31. width: 150 * screenScaleFactor
  32. anchors.verticalCenter: parent.verticalCenter
  33. }
  34. TextField {
  35. id: peak_height
  36. objectName: "Peak_Height"
  37. validator: RegExpValidator {regExp: /^\d{1,3}([\,|\.]\d*)?$/}
  38. width: 180 * screenScaleFactor
  39. onTextChanged: { manager.onPeakHeightChanged(text) }
  40. }
  41. }
  42. }
  43. UM.TooltipArea {
  44. Layout.fillWidth:true
  45. height: childrenRect.height
  46. text: catalog.i18nc("@info:tooltip","The base height from the build plate in millimeters.")
  47. Row {
  48. width: parent.width
  49. Label {
  50. text: catalog.i18nc("@action:label", "Base (mm)")
  51. width: 150 * screenScaleFactor
  52. anchors.verticalCenter: parent.verticalCenter
  53. }
  54. TextField {
  55. id: base_height
  56. objectName: "Base_Height"
  57. validator: RegExpValidator {regExp: /^\d{1,3}([\,|\.]\d*)?$/}
  58. width: 180 * screenScaleFactor
  59. onTextChanged: { manager.onBaseHeightChanged(text) }
  60. }
  61. }
  62. }
  63. UM.TooltipArea {
  64. Layout.fillWidth:true
  65. height: childrenRect.height
  66. text: catalog.i18nc("@info:tooltip","The width in millimeters on the build plate.")
  67. Row {
  68. width: parent.width
  69. Label {
  70. text: catalog.i18nc("@action:label", "Width (mm)")
  71. width: 150 * screenScaleFactor
  72. anchors.verticalCenter: parent.verticalCenter
  73. }
  74. TextField {
  75. id: width
  76. objectName: "Width"
  77. focus: true
  78. validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
  79. width: 180 * screenScaleFactor
  80. onTextChanged: { manager.onWidthChanged(text) }
  81. }
  82. }
  83. }
  84. UM.TooltipArea {
  85. Layout.fillWidth:true
  86. height: childrenRect.height
  87. text: catalog.i18nc("@info:tooltip","The depth in millimeters on the build plate")
  88. Row {
  89. width: parent.width
  90. Label {
  91. text: catalog.i18nc("@action:label", "Depth (mm)")
  92. width: 150 * screenScaleFactor
  93. anchors.verticalCenter: parent.verticalCenter
  94. }
  95. TextField {
  96. id: depth
  97. objectName: "Depth"
  98. focus: true
  99. validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
  100. width: 180 * screenScaleFactor
  101. onTextChanged: { manager.onDepthChanged(text) }
  102. }
  103. }
  104. }
  105. UM.TooltipArea {
  106. Layout.fillWidth:true
  107. height: childrenRect.height
  108. 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.")
  109. Row {
  110. width: parent.width
  111. //Empty label so 2 column layout works.
  112. Label {
  113. text: ""
  114. width: 150 * screenScaleFactor
  115. anchors.verticalCenter: parent.verticalCenter
  116. }
  117. ComboBox {
  118. id: lighter_is_higher
  119. objectName: "Lighter_Is_Higher"
  120. model: [ catalog.i18nc("@item:inlistbox","Darker is higher"), catalog.i18nc("@item:inlistbox","Lighter is higher") ]
  121. width: 180 * screenScaleFactor
  122. onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) }
  123. }
  124. }
  125. }
  126. UM.TooltipArea {
  127. Layout.fillWidth:true
  128. height: childrenRect.height
  129. 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.")
  130. Row {
  131. width: parent.width
  132. Label {
  133. text: "Color Model"
  134. width: 150 * screenScaleFactor
  135. anchors.verticalCenter: parent.verticalCenter
  136. }
  137. ComboBox {
  138. id: color_model
  139. objectName: "ColorModel"
  140. model: [ catalog.i18nc("@item:inlistbox","Linear"), catalog.i18nc("@item:inlistbox","Translucency") ]
  141. width: 180 * screenScaleFactor
  142. onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) }
  143. }
  144. }
  145. }
  146. UM.TooltipArea {
  147. Layout.fillWidth:true
  148. height: childrenRect.height
  149. 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.")
  150. visible: color_model.currentText == catalog.i18nc("@item:inlistbox","Translucency")
  151. Row {
  152. width: parent.width
  153. Label {
  154. text: catalog.i18nc("@action:label", "1mm Transmittance (%)")
  155. width: 150 * screenScaleFactor
  156. anchors.verticalCenter: parent.verticalCenter
  157. }
  158. TextField {
  159. id: transmittance
  160. objectName: "Transmittance"
  161. focus: true
  162. validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
  163. width: 180 * screenScaleFactor
  164. onTextChanged: { manager.onTransmittanceChanged(text) }
  165. }
  166. }
  167. }
  168. UM.TooltipArea {
  169. Layout.fillWidth:true
  170. height: childrenRect.height
  171. text: catalog.i18nc("@info:tooltip","The amount of smoothing to apply to the image.")
  172. Row {
  173. width: parent.width
  174. Label {
  175. text: catalog.i18nc("@action:label", "Smoothing")
  176. width: 150 * screenScaleFactor
  177. anchors.verticalCenter: parent.verticalCenter
  178. }
  179. Item {
  180. width: 180 * screenScaleFactor
  181. height: 20 * screenScaleFactor
  182. Layout.fillWidth: true
  183. Slider {
  184. id: smoothing
  185. objectName: "Smoothing"
  186. maximumValue: 100.0
  187. stepSize: 1.0
  188. width: 180
  189. onValueChanged: { manager.onSmoothingChanged(value) }
  190. }
  191. }
  192. }
  193. }
  194. }
  195. rightButtons: [
  196. Button
  197. {
  198. id:ok_button
  199. text: catalog.i18nc("@action:button","OK");
  200. onClicked: { manager.onOkButtonClicked() }
  201. enabled: true
  202. },
  203. Button
  204. {
  205. id:cancel_button
  206. text: catalog.i18nc("@action:button","Cancel");
  207. onClicked: { manager.onCancelButtonClicked() }
  208. enabled: true
  209. }
  210. ]
  211. }