mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 06:45:09 -06:00
Speed up QMl binding evaluation for MaterialMenu
This commit is contained in:
parent
eb1ae9f18d
commit
6afd669389
1 changed files with 8 additions and 16 deletions
|
@ -14,11 +14,11 @@ Menu
|
|||
|
||||
property int extruderIndex: 0
|
||||
property string currentRootMaterialId: Cura.MachineManager.currentRootMaterialId[extruderIndex]
|
||||
property string activeMaterialId:
|
||||
{
|
||||
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex]
|
||||
return (extruder === undefined) ? "" : extruder.material.id
|
||||
}
|
||||
property var activeExtruder: Cura.MachineManager.activeMachine.extruderList[extruderIndex]
|
||||
property bool isActiveExtruderEnabled: activeExtruder === undefined ? false : activeExtruder.isEnabled
|
||||
|
||||
property string activeMaterialId: activeExtruder === undefined ? false : activeExtruder.material.id
|
||||
|
||||
property bool updateModels: true
|
||||
Cura.FavoriteMaterialsModel
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ Menu
|
|||
{
|
||||
text: model.brand + " " + model.name
|
||||
checkable: true
|
||||
enabled: Cura.MachineManager.activeMachine.extruderList[extruderIndex].isEnabled
|
||||
enabled: isActiveExtruderEnabled
|
||||
checked: model.root_material_id === menu.currentRootMaterialId
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
exclusiveGroup: favoriteGroup // One favorite and one item from the others can be active at the same time.
|
||||
|
@ -77,11 +77,7 @@ Menu
|
|||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
enabled:
|
||||
{
|
||||
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex]
|
||||
return (extruder === undefined) ? false : extruder.isEnabled
|
||||
}
|
||||
enabled: isActiveExtruderEnabled
|
||||
checked: model.root_material_id === menu.currentRootMaterialId
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
|
@ -120,11 +116,7 @@ Menu
|
|||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
enabled:
|
||||
{
|
||||
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex]
|
||||
return (extruder === undefined) ? false : extruder.isEnabled
|
||||
}
|
||||
enabled: isActiveExtruderEnabled
|
||||
checked: model.id === menu.activeMaterialId
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue