decouple UI definitions from document modules

This commit is contained in:
Qingping Hou authored and Frans de Jonge committed 2019-03-03 13:10:45 +01:00
1 parent 02eca23649
commit 9e57e56f95
9 files changed
+73 -24

No files matched your search

@@ -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 = {