Another round of ReaderFooter fixes (#6830)

* When auto_refresh_time is enabled, don't actually refresh anything when the footer is hidden.
* Fix a bunch of state tracking related to height computations, meaning `getHeight()` is now actually accurate, always, and we don't need shitty workarounds anymore.
  * `footer_container.dimen.h` *includes* the progress bar, so, never reset it to 0 unless the progress bar is disabled (some `settings.progress_bar_position` codepaths were mistakenly doing just that).
  * More aggressively set/reset `footer_text.height` (not sure this one makes much of a difference, and/or if it's actually useful at all, but, the tracking was already there, but hella inconsistent, so, just fix it).
* Honor `settings.reclaim_height` in other bits of code that were only checking `footer_visible` to figure out the visible page area.
* Ask ReaderView to update the `visible_area` *now* when toggling the footer's visibility (for ReaderPaging).
This commit is contained in:
NiLuJe
2020-10-27 16:48:34 +01:00
committed by GitHub
parent c810a19040
commit a393137273
5 changed files with 67 additions and 25 deletions

View File

@@ -693,7 +693,7 @@ end
function ReaderRolling:onGotoViewRel(diff)
logger.dbg("goto relative screen:", diff, ", in mode: ", self.view.view_mode)
if self.view.view_mode == "scroll" then
local footer_height = (self.view.footer_visible and 1 or 0) * self.view.footer:getHeight()
local footer_height = ((self.view.footer_visible and not self.view.footer.settings.reclaim_height) and 1 or 0) * self.view.footer:getHeight()
local page_visible_height = self.ui.dimen.h - footer_height
local pan_diff = diff * page_visible_height
if self.show_overlap_enable then
@@ -869,7 +869,7 @@ function ReaderRolling:_gotoPos(new_pos, do_dim_area)
if new_pos > max_pos then new_pos = max_pos end
-- adjust dim_area according to new_pos
if self.view.view_mode ~= "page" and self.show_overlap_enable and do_dim_area then
local footer_height = (self.view.footer_visible and 1 or 0) * self.view.footer:getHeight()
local footer_height = ((self.view.footer_visible and not self.view.footer.settings.reclaim_height) and 1 or 0) * self.view.footer:getHeight()
local page_visible_height = self.ui.dimen.h - footer_height
local panned_step = new_pos - self.current_pos
self.view.dim_area.x = 0