Merge branch '4.0' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2018-12-13 19:40:59 +01:00
commit 8f04316ef8
2 changed files with 15 additions and 11 deletions

View file

@ -278,29 +278,33 @@ UM.MainWindow
height: UM.Theme.getSize("stage_menu").height
source: UM.Controller.activeStage != null ? UM.Controller.activeStage.stageMenuComponent : ""
// HACK: This is to ensure that the parent never gets set to null, as this wreaks havoc on the focus.
function onParentDestroyed()
{
printSetupSelector.parent = stageMenu
printSetupSelector.visible = false
}
property Item oldParent: null
// The printSetupSelector is defined here so that the setting list doesn't need to get re-instantiated
// Every time the stage is changed.
property var printSetupSelector: Cura.PrintSetupSelector
{
width: UM.Theme.getSize("print_setup_widget").width
height: UM.Theme.getSize("stage_menu").height
headerCornerSide: RoundedRectangle.Direction.Right
onParentChanged:
{
visible = parent != stageMenu
parent.Component.destruction.connect(stageMenu.onParentDestroyed)
}
width: UM.Theme.getSize("print_setup_widget").width
height: UM.Theme.getSize("stage_menu").height
headerCornerSide: RoundedRectangle.Direction.Right
onParentChanged:
{
if(stageMenu.oldParent !=null)
{
stageMenu.oldParent.Component.destruction.disconnect(stageMenu.onParentDestroyed)
}
stageMenu.oldParent = parent
visible = parent != stageMenu
parent.Component.destruction.connect(stageMenu.onParentDestroyed)
}
}
}
UM.MessageStack
{
anchors

View file

@ -54,7 +54,7 @@ Item
{
text: model.name.toUpperCase()
checkable: true
checked: model.id == UM.Controller.activeStage.stageId
checked: UM.Controller.activeStage != null ? model.id == UM.Controller.activeStage.stageId : false
anchors.verticalCenter: parent.verticalCenter
exclusiveGroup: mainWindowHeaderMenuGroup