PrintSetupSelectorHeader.qml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. elide: Text.ElideMiddle
  36. UM.SettingPropertyProvider
  37. {
  38. id: layerHeight
  39. containerStack: Cura.MachineManager.activeStack
  40. key: "layer_height"
  41. watchedProperties: ["value"]
  42. }
  43. }
  44. Cura.IconWithText
  45. {
  46. source: UM.Theme.getIcon("category_infill")
  47. text: Cura.MachineManager.activeStack ? parseInt(infillDensity.properties.value) + "%" : "0%"
  48. font: UM.Theme.getFont("medium")
  49. UM.SettingPropertyProvider
  50. {
  51. id: infillDensity
  52. containerStack: Cura.MachineManager.activeStack
  53. key: "infill_sparse_density"
  54. watchedProperties: ["value"]
  55. }
  56. }
  57. Cura.IconWithText
  58. {
  59. source: UM.Theme.getIcon("category_support")
  60. text: supportEnabled.properties.value == "True" ? enabledText : disabledText
  61. font: UM.Theme.getFont("medium")
  62. UM.SettingPropertyProvider
  63. {
  64. id: supportEnabled
  65. containerStack: Cura.MachineManager.activeMachine
  66. key: "support_enable"
  67. watchedProperties: ["value"]
  68. }
  69. }
  70. Cura.IconWithText
  71. {
  72. source: UM.Theme.getIcon("category_adhesion")
  73. text: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" ? enabledText : disabledText
  74. font: UM.Theme.getFont("medium")
  75. UM.SettingPropertyProvider
  76. {
  77. id: platformAdhesionType
  78. containerStack: Cura.MachineManager.activeMachine
  79. key: "adhesion_type"
  80. watchedProperties: [ "value"]
  81. }
  82. }
  83. }