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).
pull/5917/head
poire-z 4 years ago committed by GitHub
parent 8a3d4a1d25
commit 72f2cef472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -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"),
{

Loading…
Cancel
Save