mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-26 20:31:35 -07:00
Also disconnect the signal for the old parent of printSetupSelector
This commit is contained in:
parent
3d4da94b36
commit
856c1dcb20
1 changed files with 14 additions and 10 deletions
|
|
@ -278,29 +278,33 @@ 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.
|
||||||
property var printSetupSelector: Cura.PrintSetupSelector
|
property var printSetupSelector: Cura.PrintSetupSelector
|
||||||
{
|
{
|
||||||
width: UM.Theme.getSize("print_setup_widget").width
|
width: UM.Theme.getSize("print_setup_widget").width
|
||||||
height: UM.Theme.getSize("stage_menu").height
|
height: UM.Theme.getSize("stage_menu").height
|
||||||
headerCornerSide: RoundedRectangle.Direction.Right
|
headerCornerSide: RoundedRectangle.Direction.Right
|
||||||
onParentChanged:
|
onParentChanged:
|
||||||
{
|
{
|
||||||
visible = parent != stageMenu
|
if(stageMenu.oldParent !=null)
|
||||||
parent.Component.destruction.connect(stageMenu.onParentDestroyed)
|
{
|
||||||
}
|
stageMenu.oldParent.Component.destruction.disconnect(stageMenu.onParentDestroyed)
|
||||||
|
}
|
||||||
|
stageMenu.oldParent = parent
|
||||||
|
visible = parent != stageMenu
|
||||||
|
parent.Component.destruction.connect(stageMenu.onParentDestroyed)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.MessageStack
|
UM.MessageStack
|
||||||
{
|
{
|
||||||
anchors
|
anchors
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue