mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 22:19:00 +08:00
Create tooltips on demand instead of on creation.
This makes the loading of setting items a *lot* more faster, as each string takes about 2.5 ms to create (and we load all of them in memory!).
This commit is contained in:
parent
5f2984b77e
commit
4cc8bf5946
@ -56,7 +56,8 @@ Item
|
|||||||
signal showTooltip(string text)
|
signal showTooltip(string text)
|
||||||
signal hideTooltip()
|
signal hideTooltip()
|
||||||
signal showAllHiddenInheritedSettings(string category_id)
|
signal showAllHiddenInheritedSettings(string category_id)
|
||||||
property string tooltipText:
|
|
||||||
|
function createTooltipText()
|
||||||
{
|
{
|
||||||
var affects = settingDefinitionsModel.getRequiredBy(definition.key, "value")
|
var affects = settingDefinitionsModel.getRequiredBy(definition.key, "value")
|
||||||
var affected_by = settingDefinitionsModel.getRequires(definition.key, "value")
|
var affected_by = settingDefinitionsModel.getRequires(definition.key, "value")
|
||||||
@ -127,7 +128,7 @@ Item
|
|||||||
|
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
base.showTooltip(base.tooltipText)
|
base.showTooltip(base.createTooltipText())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +192,7 @@ Item
|
|||||||
}
|
}
|
||||||
base.showTooltip(tooltipText)
|
base.showTooltip(tooltipText)
|
||||||
}
|
}
|
||||||
onExited: base.showTooltip(base.tooltipText)
|
onExited: base.showTooltip(base.createTooltipText())
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.SimpleButton
|
UM.SimpleButton
|
||||||
@ -228,7 +229,7 @@ Item
|
|||||||
hoverTimer.stop()
|
hoverTimer.stop()
|
||||||
base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile."))
|
base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile."))
|
||||||
}
|
}
|
||||||
onExited: base.showTooltip(base.tooltipText)
|
onExited: base.showTooltip(base.createTooltipText())
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.SimpleButton
|
UM.SimpleButton
|
||||||
@ -322,7 +323,7 @@ Item
|
|||||||
iconSource: UM.Theme.getIcon("formula")
|
iconSource: UM.Theme.getIcon("formula")
|
||||||
|
|
||||||
onEntered: { hoverTimer.stop(); base.showTooltip(catalog.i18nc("@label", "This setting is normally calculated, but it currently has an absolute value set.\n\nClick to restore the calculated value.")) }
|
onEntered: { hoverTimer.stop(); base.showTooltip(catalog.i18nc("@label", "This setting is normally calculated, but it currently has an absolute value set.\n\nClick to restore the calculated value.")) }
|
||||||
onExited: base.showTooltip(base.tooltipText)
|
onExited: base.showTooltip(base.createTooltipText())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user