diff --git a/frontend/apps/reader/modules/readerstyletweak.lua b/frontend/apps/reader/modules/readerstyletweak.lua index da3c2cd21..e3b2a18a3 100644 --- a/frontend/apps/reader/modules/readerstyletweak.lua +++ b/frontend/apps/reader/modules/readerstyletweak.lua @@ -312,7 +312,9 @@ end function ReaderStyleTweak:onReadSettings(config) self.enabled = not (config:readSetting("style_tweaks_enabled") == false) self.doc_tweaks = config:readSetting("style_tweaks") or {} - self.global_tweaks = G_reader_settings:readSetting("style_tweaks") or {} + -- Default globally enabled style tweaks (for new installations) + -- are defined in css_tweaks.lua + self.global_tweaks = G_reader_settings:readSetting("style_tweaks") or CssTweaks.DEFAULT_GLOBAL_STYLE_TWEAKS self:updateCssText() end @@ -323,7 +325,7 @@ function ReaderStyleTweak:onSaveSettings() self.ui.doc_settings:saveSetting("style_tweaks_enabled", false) end self.ui.doc_settings:saveSetting("style_tweaks", util.tableSize(self.doc_tweaks) > 0 and self.doc_tweaks or nil) - G_reader_settings:saveSetting("style_tweaks", util.tableSize(self.global_tweaks) > 0 and self.global_tweaks or nil) + G_reader_settings:saveSetting("style_tweaks", self.global_tweaks) end function ReaderStyleTweak:init() diff --git a/frontend/ui/data/css_tweaks.lua b/frontend/ui/data/css_tweaks.lua index b04542a8d..2ecbb574b 100644 --- a/frontend/ui/data/css_tweaks.lua +++ b/frontend/ui/data/css_tweaks.lua @@ -12,7 +12,14 @@ They may have the following optional attributes: local _ = require("gettext") local C_ = _.pgettext +-- Default globally enabled style tweaks, for new installations +local DEFAULT_GLOBAL_STYLE_TWEAKS = {} +-- Display in-page per-specs footnotes for EPUB and FB2: +DEFAULT_GLOBAL_STYLE_TWEAKS["footnote-inpage_epub_smaller"] = true +DEFAULT_GLOBAL_STYLE_TWEAKS["footnote-inpage_fb2"] = true + local CssTweaks = { + DEFAULT_GLOBAL_STYLE_TWEAKS = DEFAULT_GLOBAL_STYLE_TWEAKS, { title = C_("Style tweaks category", "Pages"), {