mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 03:29:03 +08:00
Precompute delegate height for settingview
Speed up the rendering of settingitems a bit
This commit is contained in:
parent
b7296dd700
commit
c5d5cd2c59
@ -246,13 +246,14 @@ Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
property int indexWithFocus: -1
|
property int indexWithFocus: -1
|
||||||
|
property double delegateHeight: UM.Theme.getSize("section").height + 2 * UM.Theme.getSize("default_lining").height
|
||||||
property string activeMachineId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id : ""
|
property string activeMachineId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id : ""
|
||||||
delegate: Loader
|
delegate: Loader
|
||||||
{
|
{
|
||||||
id: delegate
|
id: delegate
|
||||||
|
|
||||||
width: scrollView.width
|
width: scrollView.width
|
||||||
height: provider.properties.enabled === "True" ? UM.Theme.getSize("section").height + 2 * UM.Theme.getSize("default_lining").height : 0
|
height: provider.properties.enabled === "True" ? contents.delegateHeight: 0
|
||||||
Behavior on height { NumberAnimation { duration: 100 } }
|
Behavior on height { NumberAnimation { duration: 100 } }
|
||||||
opacity: provider.properties.enabled === "True" ? 1 : 0
|
opacity: provider.properties.enabled === "True" ? 1 : 0
|
||||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user