PrintSetupSelectorHeader.qml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 text = Cura.MachineManager.activeQualityOrQualityChangesName
  20. // If this is a custom quality, add intent (if present) and quality it is based on
  21. if (Cura.MachineManager.isActiveQualityCustom)
  22. {
  23. if (Cura.MachineManager.activeIntentName != "")
  24. {
  25. text += " - " + Cura.MachineManager.activeIntentName
  26. }
  27. text += " - " + Cura.MachineManager.activeQualityName
  28. }
  29. if (!Cura.MachineManager.hasNotSupportedQuality)
  30. {
  31. text += " - " + layerHeight.properties.value + "mm"
  32. text += Cura.MachineManager.isActiveQualityExperimental ? " - " + catalog.i18nc("@label", "Experimental") : ""
  33. }
  34. return text
  35. }
  36. return ""
  37. }
  38. font: UM.Theme.getFont("medium")
  39. UM.SettingPropertyProvider
  40. {
  41. id: layerHeight
  42. containerStack: Cura.MachineManager.activeStack
  43. key: "layer_height"
  44. watchedProperties: ["value"]
  45. }
  46. }
  47. Cura.IconWithText
  48. {
  49. source: UM.Theme.getIcon("category_infill")
  50. text: Cura.MachineManager.activeStack ? parseInt(infillDensity.properties.value) + "%" : "0%"
  51. font: UM.Theme.getFont("medium")
  52. UM.SettingPropertyProvider
  53. {
  54. id: infillDensity
  55. containerStack: Cura.MachineManager.activeStack
  56. key: "infill_sparse_density"
  57. watchedProperties: ["value"]
  58. }
  59. }
  60. Cura.IconWithText
  61. {
  62. source: UM.Theme.getIcon("category_support")
  63. text: supportEnabled.properties.value == "True" ? enabledText : disabledText
  64. font: UM.Theme.getFont("medium")
  65. UM.SettingPropertyProvider
  66. {
  67. id: supportEnabled
  68. containerStack: Cura.MachineManager.activeMachine
  69. key: "support_enable"
  70. watchedProperties: ["value"]
  71. }
  72. }
  73. Cura.IconWithText
  74. {
  75. source: UM.Theme.getIcon("category_adhesion")
  76. text: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" ? enabledText : disabledText
  77. font: UM.Theme.getFont("medium")
  78. UM.SettingPropertyProvider
  79. {
  80. id: platformAdhesionType
  81. containerStack: Cura.MachineManager.activeMachine
  82. key: "adhesion_type"
  83. watchedProperties: [ "value"]
  84. }
  85. }
  86. }