mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 07:19:05 +08:00
Prevent the parent of printSetupSelector from being set to null
If it's parent gets set to null it will break the focus, which we need for the binding updates. CURA-5941
This commit is contained in:
parent
b7ea075fa9
commit
d48e89e224
@ -278,6 +278,14 @@ 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
|
||||
}
|
||||
|
||||
// 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
|
||||
@ -285,6 +293,11 @@ UM.MainWindow
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user