PrintSetupSelectorHeader.qml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Controls 2.3
  5. import QtQuick.Layouts 1.3
  6. import UM 1.3 as UM
  7. import Cura 1.0 as Cura
  8. RowLayout
  9. {
  10. property string enabledText: catalog.i18nc("@label:Should be short", "On")
  11. property string disabledText: catalog.i18nc("@label:Should be short", "Off")
  12. Cura.IconWithText
  13. {
  14. source: UM.Theme.getIcon("category_layer_height")
  15. text:
  16. {
  17. if (Cura.MachineManager.activeStack)
  18. {
  19. var text = Cura.MachineManager.activeQualityOrQualityChangesName
  20. if (!Cura.MachineManager.hasNotSupportedQuality)
  21. {
  22. text += " " + layerHeight.properties.value + "mm"
  23. text += Cura.MachineManager.isActiveQualityExperimental ? " - " + catalog.i18nc("@label", "Experimental") : ""
  24. }
  25. return text
  26. }
  27. return ""
  28. }
  29. font: UM.Theme.getFont("medium")
  30. UM.SettingPropertyProvider
  31. {
  32. id: layerHeight
  33. containerStack: Cura.MachineManager.activeStack
  34. key: "layer_height"
  35. watchedProperties: ["value"]
  36. }
  37. }
  38. Cura.IconWithText
  39. {
  40. source: UM.Theme.getIcon("category_infill")
  41. text: Cura.MachineManager.activeStack ? parseInt(infillDensity.properties.value) + "%" : "0%"
  42. font: UM.Theme.getFont("medium")
  43. UM.SettingPropertyProvider
  44. {
  45. id: infillDensity
  46. containerStack: Cura.MachineManager.activeStack
  47. key: "infill_sparse_density"
  48. watchedProperties: ["value"]
  49. }
  50. }
  51. Cura.IconWithText
  52. {
  53. source: UM.Theme.getIcon("category_support")
  54. text: supportEnabled.properties.value == "True" ? enabledText : disabledText
  55. font: UM.Theme.getFont("medium")
  56. UM.SettingPropertyProvider
  57. {
  58. id: supportEnabled
  59. containerStack: Cura.MachineManager.activeMachine
  60. key: "support_enable"
  61. watchedProperties: ["value"]
  62. }
  63. }
  64. Cura.IconWithText
  65. {
  66. source: UM.Theme.getIcon("category_adhesion")
  67. text: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" ? enabledText : disabledText
  68. font: UM.Theme.getFont("medium")
  69. UM.SettingPropertyProvider
  70. {
  71. id: platformAdhesionType
  72. containerStack: Cura.MachineManager.activeMachine
  73. key: "adhesion_type"
  74. watchedProperties: [ "value"]
  75. }
  76. }
  77. }