2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00

ReaderFooter:

* Flush mode to settings ASAP when an unrelated option updates the mode.
    Fixes, among other things, *enabling* the progress bar while the status
    bar is hidden: this showed it, but kept mode as "off".
  * Don't stomp on the current mode when toggling the progress bar.
    And *always* pop the status bar back up to see the difference, even if
    it's hidden.
    This used to be done only when *enabling* the progress bar.
This commit is contained in:
NiLuJe 2021-01-06 18:25:13 +01:00
parent f67296942f
commit 1925f6e653

View File

@ -872,9 +872,11 @@ function ReaderFooter:addToMainMenu(menu_items)
if self.settings.all_at_once then if self.settings.all_at_once then
self.mode = self.mode_list.page_progress self.mode = self.mode_list.page_progress
self:applyFooterMode() self:applyFooterMode()
G_reader_settings:saveSetting("reader_footer_mode", self.mode)
else
G_reader_settings:saveSetting("reader_footer_mode", first_enabled_mode_num)
end end
should_signal = true should_signal = true
G_reader_settings:saveSetting("reader_footer_mode", first_enabled_mode_num)
elseif self.reclaim_height ~= prev_reclaim_height then elseif self.reclaim_height ~= prev_reclaim_height then
should_signal = true should_signal = true
should_update = true should_update = true
@ -899,6 +901,7 @@ function ReaderFooter:addToMainMenu(menu_items)
end end
should_update = true should_update = true
self:applyFooterMode() self:applyFooterMode()
G_reader_settings:saveSetting("reader_footer_mode", self.mode)
end end
if should_update or should_signal then if should_update or should_signal then
self:refreshFooter(should_update, should_signal) self:refreshFooter(should_update, should_signal)
@ -1370,8 +1373,12 @@ function ReaderFooter:addToMainMenu(menu_items)
self.settings.disable_progress_bar = not self.settings.disable_progress_bar self.settings.disable_progress_bar = not self.settings.disable_progress_bar
if not self.settings.disable_progress_bar then if not self.settings.disable_progress_bar then
self:setTocMarkers() self:setTocMarkers()
end
-- If the status bar is currently disabled, switch to an innocuous mode to display it
if not self.view.footer_visible then
self.mode = self.mode_list.page_progress self.mode = self.mode_list.page_progress
self:applyFooterMode() self:applyFooterMode()
G_reader_settings:saveSetting("reader_footer_mode", self.mode)
end end
self:refreshFooter(true, true) self:refreshFooter(true, true)
end, end,