Only instantiate setting menus when it's visible

This saves a bit of time on booting and prevents unneeded updates (
because it doesn't matter if a setting changes if no-one is watching!)
This commit is contained in:
Jaime van Kessel 2019-02-21 20:20:01 +01:00
parent dee739db8b
commit 7754b8a447
2 changed files with 5 additions and 2 deletions

View file

@ -14,10 +14,14 @@ Menu
PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") }
onAboutToShow: extruderInstantiator.active = true
onAboutToHide: extruderInstantiator.active = false
Instantiator
{
id: extruderInstantiator
model: Cura.MachineManager.activeMachine.extruderList
active: false
asynchronous: true
Menu
{
title: modelData.name