mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user