mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user