mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 15:29:00 +08:00
Improve the bindings for the material menu
This way the evaluation is significantly faster.
This commit is contained in:
parent
b2df5c3445
commit
27370dd45d
@ -13,7 +13,8 @@ Menu
|
|||||||
title: catalog.i18nc("@label:category menu label", "Material")
|
title: catalog.i18nc("@label:category menu label", "Material")
|
||||||
|
|
||||||
property int extruderIndex: 0
|
property int extruderIndex: 0
|
||||||
|
property string currentRootMaterialId: Cura.MachineManager.currentRootMaterialId[extruderIndex]
|
||||||
|
property string activeMaterialId: Cura.MachineManager.allActiveMaterialIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
|
||||||
Cura.FavoriteMaterialsModel
|
Cura.FavoriteMaterialsModel
|
||||||
{
|
{
|
||||||
id: favoriteMaterialsModel
|
id: favoriteMaterialsModel
|
||||||
@ -45,7 +46,7 @@ Menu
|
|||||||
{
|
{
|
||||||
text: model.brand + " " + model.name
|
text: model.brand + " " + model.name
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: model.root_material_id == Cura.MachineManager.currentRootMaterialId[extruderIndex]
|
checked: model.root_material_id === menu.currentRootMaterialId
|
||||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||||
exclusiveGroup: group
|
exclusiveGroup: group
|
||||||
}
|
}
|
||||||
@ -67,7 +68,7 @@ Menu
|
|||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: model.root_material_id == Cura.MachineManager.currentRootMaterialId[extruderIndex]
|
checked: model.root_material_id === menu.currentRootMaterialId
|
||||||
exclusiveGroup: group
|
exclusiveGroup: group
|
||||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||||
}
|
}
|
||||||
@ -105,7 +106,7 @@ Menu
|
|||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: model.id == Cura.MachineManager.allActiveMaterialIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
|
checked: model.id === menu.activeMaterialId
|
||||||
exclusiveGroup: group
|
exclusiveGroup: group
|
||||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user