Since we can set the user agent font size in the standalone viewer, use that instead of overriding the font size of <html>

This commit is contained in:
Kovid Goyal 2019-09-16 11:13:45 +05:30
parent 15a512f3c8
commit 9448bf3537
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 3 deletions

View File

@ -463,9 +463,9 @@ class WebView(RestartingWebEngineView):
elif key != '*':
sd = vprefs['session_data']
sd[key] = val
if key == 'standalone_font_settings':
apply_font_settings(self._page)
vprefs['session_data'] = sd
if key in ('standalone_font_settings', 'base_font_size'):
apply_font_settings(self._page)
def do_callback(self, func_name, callback):
cid = next(self.callback_id_counter)

View File

@ -3,6 +3,7 @@
from __python__ import hash_literals
from elementmaker import E
from read_book.globals import runtime
opts = {}
@ -19,7 +20,8 @@ update_settings()
def apply_font_size():
document.documentElement.style.fontSize = '{}px'.format(opts.base_font_size)
if not runtime.is_standalone_viewer:
document.documentElement.style.fontSize = '{}px'.format(opts.base_font_size)
def apply_colors():