Fix default not being used for View mode and Progress bar

Default setting set by holding on the bottom config buttons
for "View mode" (scroll/page) and "Progress bar" (full/mini)
were not used.

Also, when switching Progress bar from 'full' to 'mini',
show the mini bar again.
This commit is contained in:
poire-z
2018-10-12 17:58:07 +02:00
parent 1b3d974bec
commit fa0117bb2a
4 changed files with 25 additions and 9 deletions

View File

@@ -692,14 +692,25 @@ function ReaderFooter:onHoldFooter()
return true
end
function ReaderFooter:onSetStatusLine(status_line)
function ReaderFooter:onSetStatusLine(status_line, on_read_settings)
-- Ignore this event when it is first sent by ReaderCoptListener
-- on book loading, so we stay with the saved footer settings
if on_read_settings then
return
end
-- 1 is min progress bar while 0 is full cre header progress bar
if status_line == 1 then
-- If footer was off (if previously with full status bar), make the
-- footer visible, as if we taped on it (and so we don't duplicate
-- this code - not if flipping_visible as in this case, a ges.pos
-- argument to onTapFooter(ges) is required)
if self.mode == MODE.off and not self.view.flipping_visible then
self:onTapFooter()
end
self.view.footer_visible = (self.mode ~= MODE.off)
else
self:applyFooterMode(MODE.off)
end
self.ui.document:setStatusLineProp(status_line)
self.ui:handleEvent(Event:new("UpdatePos"))
end