mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Minor state handling tweaks when the footer is disabled/invisible (#5494)
* Don't break `doc_pages` updates when it's completely disabled. (c.f., the commit's comment, doing it on every page turn seems a bit overkill, but I get that it's probably done that way because it was easier ;)). * Detect the empty footerTextGenerator properly in `_updateFooterText` (it's `""`, not `nil`). * Abort `_updateFooterText` early when the footer is invisible (and has been for a while/ever, i.e., when not requesting a repaint, like a mode switch would). * Never send `SetBottomPageMargin` events twice. * Minor tweaks to touchmenu & configdialog to avoid useless repaints (don't redraw the reader/fm unless we absolutely need to). * Make sure we show the progress bar alone instead of nothing when disabling the last enabled mode in the menu.
This commit is contained in:
@@ -614,7 +614,9 @@ function TouchMenu:updateItems()
|
||||
-- NOTE: We use a slightly ugly hack to detect a brand new menu vs. a tab switch,
|
||||
-- in order to optionally flash on initial menu popup...
|
||||
-- NOTE: Also avoid repainting what's underneath us on initial popup.
|
||||
UIManager:setDirty(self.is_fresh and self.show_parent or "all", function()
|
||||
-- NOTE: And we also only need to repaint what's behind us when switching to a smaller menu...
|
||||
local keep_bg = old_dimen and self.dimen.h >= old_dimen.h
|
||||
UIManager:setDirty((self.is_fresh or keep_bg) and self.show_parent or "all", function()
|
||||
local refresh_dimen =
|
||||
old_dimen and old_dimen:combine(self.dimen)
|
||||
or self.dimen
|
||||
|
||||
Reference in New Issue
Block a user