mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
refactor: add touch zone subsystem to inputcontainer
Touch zone decouples screen size from gesture event registration. The win here is each individual widget does not need to update gesture range on screen rotate/resize anymore. Another advantage is we now have a centralized ordered array to handle all registered touch event listeners, makes it much easier to resolve gesture range conflicts between multiple widgets. This patch also includes the following changes: * migrate readerpaging to use readerui's touch zone * migrate readerfooter to use readerui's touch zone * move inverse read direction setting to touch menu's setting tab * moved kobolight widget from readerview into readerui * various dead code cleanups and comments
This commit is contained in:
@@ -317,7 +317,15 @@ function ReaderUI:init()
|
||||
})
|
||||
end
|
||||
|
||||
--dbg(self.doc_settings)
|
||||
local ReaderKoboLight = require("apps/reader/modules/readerkobolight")
|
||||
if (Device:isKobo() and Device:hasFrontlight()) then
|
||||
self:registerModule('kobolight', ReaderKoboLight:new{
|
||||
dialog = self.dialog,
|
||||
view = self.view,
|
||||
ui = self,
|
||||
})
|
||||
end
|
||||
|
||||
-- we only read settings after all the widgets are initialized
|
||||
self:handleEvent(Event:new("ReadSettings", self.doc_settings))
|
||||
|
||||
@@ -445,8 +453,9 @@ function ReaderUI:closeDialog()
|
||||
UIManager:close(self.password_dialog)
|
||||
end
|
||||
|
||||
function ReaderUI:onSetDimensions(dimen)
|
||||
function ReaderUI:onScreenResize(dimen)
|
||||
self.dimen = dimen
|
||||
self:updateTouchZonesOnScreenResize(dimen)
|
||||
end
|
||||
|
||||
function ReaderUI:saveSettings()
|
||||
|
||||
Reference in New Issue
Block a user