PrintSetupSelectorHeader.qml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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("Sliders", "medium")
  15. iconSize: UM.Theme.getSize("button_icon").width
  16. text: Cura.MachineManager.activeQualityDisplayNameStringParts.join(" - ")
  17. font: UM.Theme.getFont("medium")
  18. elide: Text.ElideMiddle
  19. wrapMode: Text.NoWrap
  20. UM.SettingPropertyProvider
  21. {
  22. id: layerHeight
  23. containerStack: Cura.MachineManager.activeStack
  24. key: "layer_height"
  25. watchedProperties: ["value"]
  26. }
  27. }
  28. Cura.IconWithText
  29. {
  30. source: UM.Theme.getIcon("Infill1")
  31. text: Cura.MachineManager.activeStack ? parseInt(infillDensity.properties.value) + "%" : "0%"
  32. font: UM.Theme.getFont("medium")
  33. iconSize: UM.Theme.getSize("medium_button_icon").width
  34. UM.SettingPropertyProvider
  35. {
  36. id: infillDensity
  37. containerStack: Cura.MachineManager.activeStack
  38. key: "infill_sparse_density"
  39. watchedProperties: ["value"]
  40. }
  41. }
  42. Cura.IconWithText
  43. {
  44. source: UM.Theme.getIcon("Support")
  45. text: supportEnabled.properties.value == "True" ? enabledText : disabledText
  46. font: UM.Theme.getFont("medium")
  47. iconSize: UM.Theme.getSize("medium_button_icon").width
  48. UM.SettingPropertyProvider
  49. {
  50. id: supportEnabled
  51. containerStack: Cura.MachineManager.activeMachine
  52. key: "support_enable"
  53. watchedProperties: ["value"]
  54. }
  55. }
  56. Cura.IconWithText
  57. {
  58. source: UM.Theme.getIcon("Adhesion")
  59. text: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" ? enabledText : disabledText
  60. font: UM.Theme.getFont("medium")
  61. iconSize: UM.Theme.getSize("medium_button_icon").width
  62. UM.SettingPropertyProvider
  63. {
  64. id: platformAdhesionType
  65. containerStack: Cura.MachineManager.activeMachine
  66. key: "adhesion_type"
  67. watchedProperties: [ "value"]
  68. }
  69. }
  70. }