mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Dispatcher: avoid multiple cre rerenderings when many settings changed (#9651)
When a gesture/profile was updating multiple cre settings, each setting handler would emit UpdatePos which each would force a re-rendering. When this might be happening, postpone the rerendering until all are set. Needs some bit of refactoring to the events at play: introduce "DocumentRerendered" event, and use it where we used "UpdatePos" or "UpdateToc" to mean exactly that.
This commit is contained in:
@@ -908,7 +908,6 @@ function ReaderFooter:disableFooter()
|
||||
self.resetLayout = function() end
|
||||
self.updateFooterPage = function() end
|
||||
self.updateFooterPos = function() end
|
||||
self.onUpdatePos = function() end
|
||||
self.mode = self.mode_list.off
|
||||
self.view.footer_visible = false
|
||||
end
|
||||
@@ -2225,6 +2224,8 @@ function ReaderFooter:_updateFooterText(force_repaint, force_recompute)
|
||||
end
|
||||
end
|
||||
|
||||
-- Note: no need for :onDocumentRerendered(), ReaderToc will catch "DocumentRerendered"
|
||||
-- and will then emit a "TocReset" after the new ToC is made.
|
||||
function ReaderFooter:onTocReset()
|
||||
self:setTocMarkers(true)
|
||||
if self.view.view_mode == "page" then
|
||||
@@ -2263,10 +2264,6 @@ function ReaderFooter:onPosUpdate(pos, pageno)
|
||||
self:updateFooterPos()
|
||||
end
|
||||
|
||||
-- recalculate footer sizes when document page count is updated
|
||||
-- see documentation for more info about this event.
|
||||
ReaderFooter.onUpdatePos = ReaderFooter.onUpdateFooter
|
||||
|
||||
function ReaderFooter:onReaderReady()
|
||||
self.ui.menu:registerToMainMenu(self)
|
||||
self:setupTouchZones()
|
||||
|
||||
Reference in New Issue
Block a user