Style tweaks: enable EPUB/FB2 in-page footnotes by default (#5908)

Set these 2 tweaks as default global tweaks for new users
(and existing users that have not set any global defaults).
One can disable them by long-press on each of them.
Only per-specs EPUB and FB2 footnotes (other in-page footnotes
tweaks may trigger on non-footnote content on some books, so
let enabling them be a user decision).
This commit is contained in:
poire-z
2020-02-28 23:06:58 +01:00
committed by GitHub
parent 8a3d4a1d25
commit 72f2cef472
2 changed files with 11 additions and 2 deletions

View File

@@ -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()