mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 15:53:14 +08:00
Fix favorite not being checked properly in MaterialMenu
CURA-6804
This commit is contained in:
parent
71a22bf194
commit
a4ed51342c
@ -14,8 +14,7 @@ Menu
|
|||||||
|
|
||||||
property int extruderIndex: 0
|
property int extruderIndex: 0
|
||||||
property string currentRootMaterialId: Cura.MachineManager.currentRootMaterialId[extruderIndex]
|
property string currentRootMaterialId: Cura.MachineManager.currentRootMaterialId[extruderIndex]
|
||||||
|
property string activeMaterialId: Cura.MachineManager.activeMachine.extruderList[extruderIndex].material.id
|
||||||
property string activeMaterialId: Cura.MachineManager.activeMachine.extruders[extruderIndex].material.id
|
|
||||||
property bool updateModels: true
|
property bool updateModels: true
|
||||||
Cura.FavoriteMaterialsModel
|
Cura.FavoriteMaterialsModel
|
||||||
{
|
{
|
||||||
@ -53,7 +52,7 @@ Menu
|
|||||||
checkable: true
|
checkable: true
|
||||||
checked: model.root_material_id === menu.currentRootMaterialId
|
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: favoriteGroup // One favorite and one item from the others can be active at the same time.
|
||||||
}
|
}
|
||||||
onObjectAdded: menu.insertItem(index, object)
|
onObjectAdded: menu.insertItem(index, object)
|
||||||
onObjectRemoved: menu.removeItem(index)
|
onObjectRemoved: menu.removeItem(index)
|
||||||
@ -127,10 +126,16 @@ Menu
|
|||||||
onObjectRemoved: menu.removeItem(object)
|
onObjectRemoved: menu.removeItem(object)
|
||||||
}
|
}
|
||||||
|
|
||||||
ExclusiveGroup {
|
ExclusiveGroup
|
||||||
|
{
|
||||||
id: group
|
id: group
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExclusiveGroup
|
||||||
|
{
|
||||||
|
id: favoriteGroup
|
||||||
|
}
|
||||||
|
|
||||||
MenuSeparator {}
|
MenuSeparator {}
|
||||||
|
|
||||||
MenuItem
|
MenuItem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user