ReaderGesture: cleanup (#6292)

convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
This commit is contained in:
yparitcher
2020-07-12 14:47:49 -04:00
committed by GitHub
parent f4dad2fae8
commit 70f89c4df1
26 changed files with 585 additions and 595 deletions

View File

@@ -27,11 +27,10 @@ if Device:isCervantes() then
end
if Device:hasFrontlight() then
local ReaderFrontLight = require("apps/reader/modules/readerfrontlight")
common_settings.frontlight = {
text = _("Frontlight"),
callback = function()
ReaderFrontLight:onShowFlDialog()
UIManager:broadcastEvent(Event:new("ShowFlDialog"))
end,
}
end
@@ -166,10 +165,7 @@ common_settings.night_mode = {
text = _("Night mode"),
checked_func = function() return G_reader_settings:isTrue("night_mode") end,
callback = function()
local night_mode = G_reader_settings:isTrue("night_mode")
Screen:toggleNightMode()
UIManager:setDirty(nil, "full")
G_reader_settings:saveSetting("night_mode", not night_mode)
UIManager:broadcastEvent(Event:new("ToggleNightMode"))
end
}
common_settings.network = {