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

View File

@ -54,7 +54,7 @@ Item
{ {
text: model.name.toUpperCase() text: model.name.toUpperCase()
checkable: true 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 anchors.verticalCenter: parent.verticalCenter
exclusiveGroup: mainWindowHeaderMenuGroup exclusiveGroup: mainWindowHeaderMenuGroup