mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 13:34:01 -06:00
Add intents per category to the intent menu
They are in the wrong order currently. The section headers all appear at the end and they are not greyed out. This must be fixed. The order might prove difficult... We'll see, but I want this locked in now because it works. Contributes to issue CURA-6597.
This commit is contained in:
parent
45cb34c3e4
commit
32c5118ae4
1 changed files with 30 additions and 10 deletions
|
@ -14,27 +14,47 @@ Menu
|
|||
|
||||
property int extruderIndex: 0
|
||||
|
||||
Cura.IntentModel
|
||||
Cura.IntentCategoryModel
|
||||
{
|
||||
id: intentModel
|
||||
id: intentCategoryModel
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: intentModel
|
||||
model: intentCategoryModel
|
||||
|
||||
MenuItem
|
||||
MenuItem //Section header.
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checkable: false
|
||||
checked: false
|
||||
Binding on checked
|
||||
|
||||
property var per_category_intents: Cura.IntentModel
|
||||
{
|
||||
when: Cura.MachineManager.activeStack != null
|
||||
value: Cura.MachineManager.activeStack.intent == model.container
|
||||
id: intentModel
|
||||
intentCategory: model.intent_category
|
||||
}
|
||||
|
||||
property var intent_instantiator: Instantiator
|
||||
{
|
||||
model: intentModel
|
||||
MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: false
|
||||
Binding on checked
|
||||
{
|
||||
when: Cura.MachineManager.activeStack != null
|
||||
value: Cura.MachineManager.activeStack.intent.metaData["intent_category"] == intentModel.intentCategory && Cura.MachineManager.activeStack.quality.metaData["quality_type"] == model.quality_type
|
||||
}
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.IntentManager.selectIntent(intentModel.intentCategory, model.quality_type)
|
||||
}
|
||||
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.activeStack.intent = model.container
|
||||
}
|
||||
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue