move setPageMargin to the begining of document initialization to

avoid reformatting of DocView that makes previously generated
cr3cache files unused.
pull/439/head
chrox 11 years ago
parent f9445fca0d
commit 1cad93338a

@ -20,14 +20,6 @@ function ReaderCoptListener:onReadSettings(config)
self.ui:handleEvent(Event:new("SetViewMode", "scroll"))
end)
end
local copt_margins = config:readSetting("copt_page_margins")
if copt_margins == nil then
copt_margins = DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM
end
table.insert(self.ui.postInitCallback, function()
self.ui:handleEvent(Event:new("SetPageMargins", copt_margins))
end)
end
return ReaderCoptListener

@ -23,22 +23,16 @@ function ReaderTypeset:onReadSettings(config)
self.css = nil
end
self.embedded_css = config:readSetting("embedded_css")
-- default to enable embedded css
if self.embedded_css == nil then
self.embedded_css = true
self.ui.document:setEmbeddedStyleSheet(1)
end
if not self.embedded_css then
self.ui.document:setEmbeddedStyleSheet(0)
end
self.floating_punctuation = config:readSetting("floating_punctuation")
self.embedded_css = config:readSetting("embedded_css") or true
self.ui.document:setEmbeddedStyleSheet(self.embedded_css and 1 or 0)
-- default to no floating punctuation
if self.floating_punctuation == nil then
self.floating_punctuation = 0
end
self.floating_punctuation = config:readSetting("floating_punctuation") or 0
self.ui.document:setFloatingPunctuation(self.floating_punctuation)
local copt_margins = self.ui.doc_settings:readSetting("copt_page_margins") or DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM
self.ui:handleEvent(Event:new("SetPageMargins", copt_margins))
end
function ReaderTypeset:onSaveSettings()

Loading…
Cancel
Save