2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00

read settings after readerui widgets initialization

This commit is contained in:
Qingping Hou 2012-06-27 00:59:22 +08:00
parent 45e9198ab2
commit 0e122b12bf

View File

@ -42,7 +42,6 @@ function ReaderUI:init()
end end
self.doc_settings = DocSettings:open(self.document.file) self.doc_settings = DocSettings:open(self.document.file)
DEBUG(self.doc_settings)
-- a view container (so it must be child #1!) -- a view container (so it must be child #1!)
self[1] = ReaderView:new{ self[1] = ReaderView:new{
@ -91,10 +90,6 @@ function ReaderUI:init()
ui = self ui = self
} }
table.insert(self, pager) table.insert(self, pager)
if not self.start_pos then
self.start_pos = 1
end
pager:gotoPage(self.start_pos)
else else
-- rolling controller -- rolling controller
local roller = ReaderRolling:new{ local roller = ReaderRolling:new{
@ -103,10 +98,10 @@ function ReaderUI:init()
ui = self ui = self
} }
table.insert(self, roller) table.insert(self, roller)
if not self.start_pos then --if not self.start_pos then
self.start_pos = 0 --self.start_pos = 0
end --end
roller:gotoPercent(self.start_pos) --roller:gotoPercent(self.start_pos)
-- font menu -- font menu
local font_menu = ReaderFont:new{ local font_menu = ReaderFont:new{
dialog = self.dialog, dialog = self.dialog,
@ -115,6 +110,9 @@ function ReaderUI:init()
} }
table.insert(self, font_menu) table.insert(self, font_menu)
end end
--DEBUG(self.doc_settings)
-- we only read settings after all the widgets are initialized
self:handleEvent(Event:new("ReadSettings", self.doc_settings))
-- notify childs of dimensions -- notify childs of dimensions
self:handleEvent(Event:new("SetDimensions", self.dimen)) self:handleEvent(Event:new("SetDimensions", self.dimen))
end end