read global default value for using embedded stylesheets

The global configuration wasn't evaluated before.
Fixes #1364.
pull/1368/head
Hans-Werner Hilse 10 years ago
parent 13183ab45e
commit a4571c297e

@ -27,9 +27,15 @@ function ReaderTypeset:onReadSettings(config)
self.css = self.ui.document.default_css
end
-- default to enable embedded css
self.embedded_css = config:readSetting("embedded_css")
if self.embedded_css == nil then self.embedded_css = true end
if self.embedded_css == nil then
-- default to enable embedded css
-- note that it's a bit confusing here:
-- global settins store 0/1, while document settings store false/true
-- we leave it that way for now to maintain backwards compatibility
local global = G_reader_settings:readSetting("copt_embedded_css")
self.embedded_css = (global == nil or global == 1) and true or false
end
self.ui.document:setEmbeddedStyleSheet(self.embedded_css and 1 or 0)
-- set page margins

Loading…
Cancel
Save