diff --git a/frontend/apps/reader/modules/readerfooter.lua b/frontend/apps/reader/modules/readerfooter.lua index 60a7c49c5..30ca36a3c 100644 --- a/frontend/apps/reader/modules/readerfooter.lua +++ b/frontend/apps/reader/modules/readerfooter.lua @@ -2199,8 +2199,8 @@ function ReaderFooter:_updateFooterText(force_repaint, force_recompute) if force_repaint then -- If there was a visibility change, notify ReaderView if self.visibility_change then - self.ui:handleEvent(Event:new("ReaderFooterVisibilityChange")) self.visibility_change = nil + self.ui:handleEvent(Event:new("ReaderFooterVisibilityChange")) end -- NOTE: Getting the dimensions of the widget is impossible without having drawn it first, diff --git a/frontend/apps/reader/modules/readerview.lua b/frontend/apps/reader/modules/readerview.lua index f616fe7a6..b8f8f3a35 100644 --- a/frontend/apps/reader/modules/readerview.lua +++ b/frontend/apps/reader/modules/readerview.lua @@ -968,19 +968,15 @@ end function ReaderView:onReaderFooterVisibilityChange() -- Don't bother ReaderRolling with this nonsense, the footer's height is NOT handled via visible_area there ;) if self.ui.paging and self.state.page then - -- NOTE: Simply relying on recalculate would be a wee bit too much: it'd reset the in-page offsets, - -- which would be wrong, and is also not necessary, since the footer is at the bottom of the screen ;). - -- So, simply mangle visible_area's height ourselves... + -- We don't need to do anything if reclaim is enabled ;). if not self.footer.settings.reclaim_height then - -- NOTE: Yes, this means that toggling reclaim_height requires a page switch (for a proper recalculate). - -- Thankfully, most of the time, the quirks are barely noticeable ;). - if self.footer_visible then - self.visible_area.h = self.visible_area.h - self.footer:getHeight() - else - self.visible_area.h = self.visible_area.h + self.footer:getHeight() - end + -- NOTE: Mimic what onSetFullScreen does, since, without reclaim, toggling the footer affects the available area, + -- so we need to recompute the full layout. + self.ui:handleEvent(Event:new("SetDimensions", Screen:getSize())) + -- NOTE: Scroll mode's behavior after this might be suboptimal (until next page), + -- but I'm not familiar enough with it to make it behave... + -- (e.g., RedrawCurrentPage & co will snap to the top of the "current" page). end - self.ui:handleEvent(Event:new("ViewRecalculate", self.visible_area, self.page_area)) end end