ReaderFooter: Refresh the footer on frontlight state changes issued by the frontlight widget (#9084)

c.f, https://www.mobileread.com/forums/showpost.php?p=4220159&postcount=7
This commit is contained in:
NiLuJe
2022-05-09 08:36:13 +02:00
committed by GitHub
parent 49c02790f6
commit 60b043ebe9
2 changed files with 7 additions and 2 deletions

View File

@@ -2473,8 +2473,12 @@ function ReaderFooter:maybeUpdateFooter()
end
function ReaderFooter:onFrontlightStateChanged()
if self.settings.frontlight then
self:maybeUpdateFooter()
-- Custom variant of maybeUpdateFooter that *also* whitelists the FL widget...
local top_wg = UIManager:getTopWidget()
if top_wg == "ReaderUI" or top_wg == "FrontLightWidget" then
self:onUpdateFooter(self.view.footer_visible)
else
self:onUpdateFooter()
end
end