mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ReaderHeader: Skip the refresh if we're not visible
Similar in spirit to the previous commit, although since we're drawn as part of the CRe page, this is just the refresh per-se that's optimized, it had no chance to actually be visible.
This commit is contained in:
@@ -83,15 +83,16 @@ function ReaderCoptListener:updateHeader()
|
||||
-- Have crengine display accurate time and battery on its next drawing
|
||||
self.ui.rolling:updateBatteryState()
|
||||
self.ui.document:resetBufferCache() -- be sure next repaint is a redrawing
|
||||
-- Force a repaint (we could avoid it if the top menu is shown as it
|
||||
-- would fully cover the header, but let's not bother)
|
||||
UIManager:setDirty(self.view.dialog, "ui",
|
||||
Geom:new{
|
||||
x = 0, y = 0,
|
||||
w = Device.screen:getWidth(),
|
||||
h = self.ui.document:getHeaderHeight(),
|
||||
}
|
||||
)
|
||||
-- Force a refresh if we're not hidden behind another widget
|
||||
if UIManager:getTopWidget() == "ReaderUI" then
|
||||
UIManager:setDirty(self.view.dialog, "ui",
|
||||
Geom:new{
|
||||
x = 0, y = 0,
|
||||
w = Device.screen:getWidth(),
|
||||
h = self.ui.document:getHeaderHeight(),
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderCoptListener:unscheduleHeaderRefresh()
|
||||
|
||||
Reference in New Issue
Block a user