RecommendedAdhesionSelector.qml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (c) 2022 UltiMaker
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Layouts 1.3
  5. import UM 1.5 as UM
  6. import Cura 1.7 as Cura
  7. RecommendedSettingSection
  8. {
  9. id: enableAdhesionRow
  10. title: catalog.i18nc("@label", "Adhesion")
  11. icon: UM.Theme.getIcon("Adhesion")
  12. enableSectionSwitchVisible: platformAdhesionType.properties.enabled === "True"
  13. enableSectionSwitchChecked: platformAdhesionType.properties.value !== "skirt" && platformAdhesionType.properties.value !== "none"
  14. enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled
  15. tooltipText: catalog.i18nc("@label", "Enable printing a brim or raft. This will add a flat area around or under your object which is easy to cut off afterwards.")
  16. property var curaRecommendedMode: Cura.RecommendedMode {}
  17. property UM.SettingPropertyProvider platformAdhesionType: UM.SettingPropertyProvider
  18. {
  19. containerStack: Cura.MachineManager.activeMachine
  20. removeUnusedValue: false //Doesn't work with settings that are resolved.
  21. key: "adhesion_type"
  22. watchedProperties: [ "value", "resolve", "enabled" ]
  23. storeIndex: 0
  24. }
  25. function onEnableSectionChanged(state)
  26. {
  27. curaRecommendedMode.setAdhesion(state)
  28. }
  29. }