mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-01 00:04:27 +08:00

Move common functionality into SingleSettingExtruderSelectorBar Add adhesion settings CURA-9793
45 lines
1.4 KiB
QML
45 lines
1.4 KiB
QML
// Copyright (c) 2022 UltiMaker B.V.
|
|
// Cura is released under the terms of the LGPLv3 or higher.
|
|
|
|
import QtQuick 2.7
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import UM 1.5 as UM
|
|
import Cura 1.7 as Cura
|
|
|
|
|
|
RecommendedSettingSection
|
|
{
|
|
id: enableAdhesionRow
|
|
|
|
title: catalog.i18nc("@label", "Adhesion")
|
|
icon: UM.Theme.getIcon("Adhesion")
|
|
enableSectionVisible: platformAdhesionType.properties.enabled == "True"
|
|
enableSectionChecked: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none"
|
|
enableSectionEnabled: recommendedPrintSetup.settingsEnabled
|
|
|
|
property var curaRecommendedMode: Cura.RecommendedMode {}
|
|
|
|
property UM.SettingPropertyProvider platformAdhesionType: UM.SettingPropertyProvider
|
|
{
|
|
containerStack: Cura.MachineManager.activeMachine
|
|
removeUnusedValue: false //Doesn't work with settings that are resolved.
|
|
key: "adhesion_type"
|
|
watchedProperties: [ "value", "resolve", "enabled" ]
|
|
storeIndex: 0
|
|
}
|
|
|
|
function onEnableSectionChanged(state) {
|
|
curaRecommendedMode.setAdhesion(state)
|
|
}
|
|
|
|
contents: [
|
|
RecommendedSettingItem
|
|
{
|
|
Layout.preferredHeight: childrenRect.height
|
|
settingName: catalog.i18nc("@action:label", "Print with")
|
|
settingControl: Cura.SingleSettingExtruderSelectorBar { extruderSettingName: "adhesion_extruder_nr" }
|
|
}
|
|
]
|
|
}
|