mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-19 19:09:09 +08:00
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:
parent
dee739db8b
commit
7754b8a447
@ -19,7 +19,6 @@ class BaseMaterialsModel(ListModel):
|
|||||||
|
|
||||||
def __init__(self, parent = None):
|
def __init__(self, parent = None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
|
|
||||||
self._application = CuraApplication.getInstance()
|
self._application = CuraApplication.getInstance()
|
||||||
|
@ -14,10 +14,14 @@ Menu
|
|||||||
|
|
||||||
PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") }
|
PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") }
|
||||||
|
|
||||||
|
onAboutToShow: extruderInstantiator.active = true
|
||||||
|
onAboutToHide: extruderInstantiator.active = false
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
|
id: extruderInstantiator
|
||||||
model: Cura.MachineManager.activeMachine.extruderList
|
model: Cura.MachineManager.activeMachine.extruderList
|
||||||
|
active: false
|
||||||
|
asynchronous: true
|
||||||
Menu
|
Menu
|
||||||
{
|
{
|
||||||
title: modelData.name
|
title: modelData.name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user