mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Content server: Fix margin and body background color mismatch when reading books with a non-white/black color scheme. Fixes #1985058 [[Content Server] Margin colors not matching body background colors](https://bugs.launchpad.net/calibre/+bug/1985058)
This commit is contained in:
parent
62c66e9e2a
commit
7a0ccb4476
@ -798,8 +798,12 @@ class View:
|
|||||||
|
|
||||||
def apply_color_scheme(self):
|
def apply_color_scheme(self):
|
||||||
self.current_color_scheme = ans = resolve_color_scheme()
|
self.current_color_scheme = ans = resolve_color_scheme()
|
||||||
|
iframe = self.iframe
|
||||||
if runtime.is_standalone_viewer:
|
if runtime.is_standalone_viewer:
|
||||||
set_ui_colors(self.current_color_scheme.is_dark_theme)
|
set_ui_colors(self.current_color_scheme.is_dark_theme)
|
||||||
|
else:
|
||||||
|
iframe.style.colorScheme = 'dark' if self.current_color_scheme.is_dark_theme else 'light'
|
||||||
|
|
||||||
is_dark_theme(self.current_color_scheme.is_dark_theme)
|
is_dark_theme(self.current_color_scheme.is_dark_theme)
|
||||||
for which in 'left top right bottom'.split(' '):
|
for which in 'left top right bottom'.split(' '):
|
||||||
m = document.getElementById('book-{}-margin'.format(which))
|
m = document.getElementById('book-{}-margin'.format(which))
|
||||||
@ -811,7 +815,6 @@ class View:
|
|||||||
s.color = ans.foreground
|
s.color = ans.foreground
|
||||||
s.backgroundColor = ans.background
|
s.backgroundColor = ans.background
|
||||||
sd = get_session_data()
|
sd = get_session_data()
|
||||||
iframe = self.iframe
|
|
||||||
iframe.style.backgroundColor = ans.background or 'white'
|
iframe.style.backgroundColor = ans.background or 'white'
|
||||||
bg_image = sd.get('background_image')
|
bg_image = sd.get('background_image')
|
||||||
if bg_image:
|
if bg_image:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user