PrintSetupSelectorHeader.qml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  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 resultMap = Cura.MachineManager.activeQualityDisplayNameMap
  20. var text = resultMap["main"]
  21. if (resultMap["suffix"])
  22. {
  23. text += " - " + resultMap["suffix"]
  24. }
  25. if (!Cura.MachineManager.hasNotSupportedQuality)
  26. {
  27. text += " - " + layerHeight.properties.value + "mm"
  28. text += Cura.MachineManager.isActiveQualityExperimental ? " - " + catalog.i18nc("@label", "Experimental") : ""
  29. }
  30. return text
  31. }
  32. return ""
  33. }
  34. font: UM.Theme.getFont("medium")
  35. UM.SettingPropertyProvider
  36. {
  37. id: layerHeight
  38. containerStack: Cura.MachineManager.activeStack
  39. key: "layer_height"
  40. watchedProperties: ["value"]
  41. }
  42. }
  43. Cura.IconWithText
  44. {
  45. source: UM.Theme.getIcon("category_infill")
  46. text: Cura.MachineManager.activeStack ? parseInt(infillDensity.properties.value) + "%" : "0%"
  47. font: UM.Theme.getFont("medium")
  48. UM.SettingPropertyProvider
  49. {
  50. id: infillDensity
  51. containerStack: Cura.MachineManager.activeStack
  52. key: "infill_sparse_density"
  53. watchedProperties: ["value"]
  54. }
  55. }
  56. Cura.IconWithText
  57. {
  58. source: UM.Theme.getIcon("category_support")
  59. text: supportEnabled.properties.value == "True" ? enabledText : disabledText
  60. font: UM.Theme.getFont("medium")
  61. UM.SettingPropertyProvider
  62. {
  63. id: supportEnabled
  64. containerStack: Cura.MachineManager.activeMachine
  65. key: "support_enable"
  66. watchedProperties: ["value"]
  67. }
  68. }
  69. Cura.IconWithText
  70. {
  71. source: UM.Theme.getIcon("category_adhesion")
  72. text: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" ? enabledText : disabledText
  73. font: UM.Theme.getFont("medium")
  74. UM.SettingPropertyProvider
  75. {
  76. id: platformAdhesionType
  77. containerStack: Cura.MachineManager.activeMachine
  78. key: "adhesion_type"
  79. watchedProperties: [ "value"]
  80. }
  81. }
  82. }