mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Add sidebar views menu item and expose model to QML
This commit is contained in:
parent
713055e320
commit
4ef39ca313
5 changed files with 37 additions and 8 deletions
|
|
@ -12,21 +12,40 @@ Menu
|
|||
title: catalog.i18nc("@title:menu menubar:toplevel", "&View");
|
||||
id: menu
|
||||
enabled: !PrintInformation.preSliced
|
||||
|
||||
// main views
|
||||
Instantiator
|
||||
{
|
||||
model: UM.ViewModel { }
|
||||
model: UM.ViewModel{}
|
||||
MenuItem
|
||||
{
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: model.active;
|
||||
exclusiveGroup: group;
|
||||
onTriggered: UM.Controller.setActiveView(model.id);
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.active
|
||||
exclusiveGroup: group
|
||||
onTriggered: UM.Controller.setActiveView(model.id)
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
ExclusiveGroup { id: group; }
|
||||
ExclusiveGroup { id: group }
|
||||
|
||||
// sidebar views
|
||||
Instantiator
|
||||
{
|
||||
model: Cura.SidebarViewModel{}
|
||||
MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.active
|
||||
exclusiveGroup: sidebarGroup
|
||||
onTriggered: Cura.SidebarController.setActiveSidebarView(model.id)
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
ExclusiveGroup { id: sidebarGroup }
|
||||
|
||||
MenuSeparator {}
|
||||
MenuItem { action: Cura.Actions.homeCamera; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue