mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
CRE: use same marks in top and bottom progress bars
Feed to crengine the same ticks (build from the TOC entries) that we use in the bottom status bar. (crengine otherwise builds a tick for each DocFragment, which most often is really different than what's seen in the bottom bar.)
This commit is contained in:
@@ -814,6 +814,7 @@ function ReaderRolling:updatePos()
|
||||
self.ui:handleEvent(Event:new("UpdateToc"))
|
||||
self.view.footer:updateFooter()
|
||||
end
|
||||
self:updateTopStatusBarMarkers()
|
||||
UIManager:setDirty(self.view.dialog, "partial")
|
||||
-- Allow for the new rendering to be shown before possibly showing
|
||||
-- the "Styles have changes..." ConfirmBox so the user can decide
|
||||
@@ -1005,6 +1006,15 @@ function ReaderRolling:onSetStatusLine(status_line, on_read_settings)
|
||||
self.ui:handleEvent(Event:new("UpdatePos"))
|
||||
end
|
||||
|
||||
function ReaderRolling:updateTopStatusBarMarkers()
|
||||
if not self.cre_top_bar_enabled then
|
||||
return
|
||||
end
|
||||
local pages = self.ui.document:getPageCount()
|
||||
local ticks = self.ui.toc:getTocTicksForFooter()
|
||||
self.ui.document:setHeaderProgressMarks(pages, ticks)
|
||||
end
|
||||
|
||||
function ReaderRolling:updateBatteryState()
|
||||
if self.view.view_mode == "page" and self.cre_top_bar_enabled then
|
||||
logger.dbg("update battery state")
|
||||
|
||||
Reference in New Issue
Block a user