RibbonTour: Reduce memory use.

This commit is contained in:
Mentalflow 2024-05-08 22:19:41 +08:00
parent f9dde2c8eb
commit 48b20e22f7
Signed by: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
1 changed files with 5 additions and 0 deletions

View File

@ -82,6 +82,7 @@ Popup {
id: container id: container
spacing: 10 spacing: 10
Loader{ Loader{
id: loader
width: item ? item.implicitWidth : 50 width: item ? item.implicitWidth : 50
height: item ? item.implicitHeight : 50 height: item ? item.implicitHeight : 50
sourceComponent: content_source ? undefined : content_items sourceComponent: content_source ? undefined : content_items
@ -232,9 +233,13 @@ Popup {
rec.close() rec.close()
if(popup.targetList[popup.currentIndex].exit_func) if(popup.targetList[popup.currentIndex].exit_func)
popup.targetList[popup.currentIndex].exit_func() popup.targetList[popup.currentIndex].exit_func()
loader.sourceComponent = undefined
loader.source = ""
} }
onAboutToShow: { onAboutToShow: {
loader.sourceComponent = content_source ? undefined : content_items
loader.source = content_source
rec.open() rec.open()
currentTarget = targetList[0].target currentTarget = targetList[0].target
currentIndex = 0 currentIndex = 0