mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-10 09:09:03 +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")
|
||||
|
||||
property int extruderIndex: 0
|
||||
|
||||
property string currentRootMaterialId: Cura.MachineManager.currentRootMaterialId[extruderIndex]
|
||||
property string activeMaterialId: Cura.MachineManager.allActiveMaterialIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
|
||||
Cura.FavoriteMaterialsModel
|
||||
{
|
||||
id: favoriteMaterialsModel
|
||||
@ -45,7 +46,7 @@ Menu
|
||||
{
|
||||
text: model.brand + " " + model.name
|
||||
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)
|
||||
exclusiveGroup: group
|
||||
}
|
||||
@ -67,7 +68,7 @@ Menu
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.root_material_id == Cura.MachineManager.currentRootMaterialId[extruderIndex]
|
||||
checked: model.root_material_id === menu.currentRootMaterialId
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
}
|
||||
@ -105,7 +106,7 @@ Menu
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.id == Cura.MachineManager.allActiveMaterialIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
|
||||
checked: model.id === menu.activeMaterialId
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user