Merge branch 'custom_menuitems_in_sidebar' into CURA-5595_add_custom_button_to_menu

This commit is contained in:
Aleksei S 2018-07-26 13:51:07 +02:00
commit 40c51249f5
3 changed files with 69 additions and 0 deletions

View file

@ -561,6 +561,28 @@ Item
visible: machineExtruderCount.properties.value > 1
}
Instantiator
{
id: customMenuItems
model: Cura.SidebarCustomMenuItemsModel { }
MenuItem
{
text: model.name
iconName: model.iconName
onTriggered:
{
customMenuItems.model.callMenuItemMethod(name, model.actions, {"key": contextMenu.key})
}
}
onObjectAdded: contextMenu.insertItem(index, object)
onObjectRemoved: contextMenu.removeItem(object)
}
MenuSeparator
{
visible: customMenuItems.count > 0
}
MenuItem
{
//: Settings context menu action