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

View File

@@ -25,6 +25,7 @@ local _ = require("gettext")
local Screen = Device.screen
local FrontLightWidget = FocusManager:new{
name = "FrontLightWidget",
width = nil,
height = nil,
-- This should stay active during natural light configuration