pool fullscreenpage for reuse when navigating

This commit is contained in:
Drew Weymouth
2024-03-02 17:25:16 -08:00
parent 9f16e2ebd9
commit 825f4325ed
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -103,6 +103,7 @@ func (a *FullscreenPage) Save() SavedPage {
a.imageLoadCancel()
}
nps := a.fullscreenPageState
a.pool.Release(util.WidgetTypeFullscreenPage, a)
return &nps
}
@@ -140,5 +141,9 @@ func (a *FullscreenPage) Reload() {
}
func (s *fullscreenPageState) Restore() Page {
if page := s.pool.Obtain(util.WidgetTypeFullscreenPage).(*FullscreenPage); page != nil {
page.Reload()
return page
}
return NewFullscreenPage(s.contr, s.pool, s.im, s.pm, s.canRate)
}
+1
View File
@@ -15,6 +15,7 @@ const (
WidgetTypeGridView
WidgetTypePlaylistPageHeader
WidgetTypeTracklist
WidgetTypeFullscreenPage
// keep at bottom
numWidgetTypes