mirror of
https://github.com/koreader/koreader
synced 2024-10-31 21:20:20 +00:00
Add update of the top and bottom status bars, on +/-Charging (#7379)
This commit is contained in:
parent
627065c354
commit
10922561dd
@ -67,6 +67,14 @@ function ReaderCoptListener:onSetFontSize(font_size)
|
||||
self.document.configurable.font_size = font_size
|
||||
end
|
||||
|
||||
function ReaderCoptListener:onCharging()
|
||||
self:headerRefresh()
|
||||
end
|
||||
|
||||
function ReaderCoptListener:onNotCharging()
|
||||
self:headerRefresh()
|
||||
end
|
||||
|
||||
function ReaderCoptListener:onTimeFormatChanged()
|
||||
self.ui.document._document:setIntProperty("window.status.clock.12hours", G_reader_settings:isTrue("twelve_hour_clock") and 1 or 0)
|
||||
end
|
||||
|
@ -1873,6 +1873,14 @@ function ReaderFooter:onUpdateFooter(force_repaint, force_recompute)
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderFooter:onCharging()
|
||||
self:onUpdateFooter(self.view.footer_visible)
|
||||
end
|
||||
|
||||
function ReaderFooter:onNotCharging()
|
||||
self:onUpdateFooter(self.view.footer_visible)
|
||||
end
|
||||
|
||||
function ReaderFooter:updateFooterPage(force_repaint, force_recompute)
|
||||
if type(self.pageno) ~= "number" then return end
|
||||
if self.ui.document:hasHiddenFlows() then
|
||||
|
@ -199,6 +199,12 @@ function Device:init()
|
||||
end)
|
||||
end
|
||||
end
|
||||
elseif ev.code == C.AEVENT_POWER_CONNECTED then
|
||||
local Event = require("ui/event")
|
||||
UIManager:broadcastEvent(Event:new("Charging"))
|
||||
elseif ev.code == C.AEVENT_POWER_DISCONNECTED then
|
||||
local Event = require("ui/event")
|
||||
UIManager:broadcastEvent(Event:new("NotCharging"))
|
||||
end
|
||||
end,
|
||||
hasClipboardText = function()
|
||||
|
Loading…
Reference in New Issue
Block a user