mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
decouple UI definitions from document modules
This commit is contained in:
committed by
Frans de Jonge
parent
02eca23649
commit
9e57e56f95
@@ -4,6 +4,8 @@ local Event = require("ui/event")
|
||||
local Geom = require("ui/geometry")
|
||||
local InputContainer = require("ui/widget/container/inputcontainer")
|
||||
local UIManager = require("ui/uimanager")
|
||||
local CreOptions = require("ui/data/creoptions")
|
||||
local KoptOptions = require("ui/data/koptoptions")
|
||||
local _ = require("gettext")
|
||||
|
||||
local ReaderConfig = InputContainer:new{
|
||||
@@ -11,6 +13,13 @@ local ReaderConfig = InputContainer:new{
|
||||
}
|
||||
|
||||
function ReaderConfig:init()
|
||||
if self.document.koptinterface ~= nil then
|
||||
self.options = KoptOptions
|
||||
else
|
||||
self.options = CreOptions
|
||||
end
|
||||
self.configurable:loadDefaults(self.options)
|
||||
|
||||
if not self.dimen then self.dimen = Geom:new{} end
|
||||
if Device:hasKeys() then
|
||||
self.key_events = {
|
||||
|
||||
Reference in New Issue
Block a user