mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
ReadTimer: Don't blindly repaint the footer in update_status_bars
Send a dedicated event that will let ReaderFooter check if we actually have anything relevant to display, and will do the usual "should I repaint/refresh" checks ;). Fix #12323 Regression since #12002
This commit is contained in:
@@ -486,7 +486,7 @@ ReaderFooter.default_settings = {
|
|||||||
function ReaderFooter:init()
|
function ReaderFooter:init()
|
||||||
self.settings = G_reader_settings:readSetting("footer", self.default_settings)
|
self.settings = G_reader_settings:readSetting("footer", self.default_settings)
|
||||||
|
|
||||||
self.additional_footer_content = {} -- place, where additional header content can be inserted.
|
self.additional_footer_content = {} -- array, where additional header content can be inserted.
|
||||||
|
|
||||||
-- Remove items not supported by the current device
|
-- Remove items not supported by the current device
|
||||||
if not Device:hasFastWifiStatusQuery() then
|
if not Device:hasFastWifiStatusQuery() then
|
||||||
@@ -2468,6 +2468,13 @@ function ReaderFooter:onBookMetadataChanged(prop_updated)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ReaderFooter:onRefreshAdditionalContent()
|
||||||
|
if #self.additional_footer_content > 0 then
|
||||||
|
-- Can be sent an any time, so we need to be careful about the repaint/refresh
|
||||||
|
self:maybeUpdateFooter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function ReaderFooter:onCloseWidget()
|
function ReaderFooter:onCloseWidget()
|
||||||
self:free()
|
self:free()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ function ReadTimer:update_status_bars(seconds)
|
|||||||
UIManager:broadcastEvent(Event:new("UpdateHeader"))
|
UIManager:broadcastEvent(Event:new("UpdateHeader"))
|
||||||
end
|
end
|
||||||
if self.show_value_in_footer then
|
if self.show_value_in_footer then
|
||||||
UIManager:broadcastEvent(Event:new("UpdateFooter", true))
|
UIManager:broadcastEvent(Event:new("RefreshAdditionalContent"))
|
||||||
end
|
end
|
||||||
-- if seconds schedule 1ms later
|
-- if seconds schedule 1ms later
|
||||||
if seconds and seconds >= 0 then
|
if seconds and seconds >= 0 then
|
||||||
|
|||||||
Reference in New Issue
Block a user