mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
E-book viewer: Allow the background image specified in the Style section of the viewer preferences to extend under the viewer margins as well
This commit is contained in:
parent
52616a4994
commit
3d48a0a94e
@ -847,31 +847,31 @@ class View:
|
|||||||
s.backgroundColor, s.color = mc.split(':')
|
s.backgroundColor, s.color = mc.split(':')
|
||||||
else:
|
else:
|
||||||
s.color = ans.foreground
|
s.color = ans.foreground
|
||||||
s.backgroundColor = ans.background
|
s.backgroundColor = 'transparent'
|
||||||
sd = get_session_data()
|
sd = get_session_data()
|
||||||
iframe.style.backgroundColor = ans.background or 'white'
|
for node in [iframe, iframe.parentNode]:
|
||||||
|
node.style.backgroundColor = 'transparent'
|
||||||
|
node.style.backgroundImage = 'none'
|
||||||
|
s = iframe.parentNode.parentNode.style
|
||||||
bg_image = sd.get('background_image')
|
bg_image = sd.get('background_image')
|
||||||
if bg_image:
|
if bg_image:
|
||||||
iframe.style.backgroundImage = f'url({modify_background_image_url_for_fetch(bg_image)})'
|
s.backgroundImage = f'url({modify_background_image_url_for_fetch(bg_image)})'
|
||||||
else:
|
else:
|
||||||
iframe.style.backgroundImage = 'none'
|
s.backgroundColor = ans.background or 'white'
|
||||||
|
s.backgroundImage = 'none'
|
||||||
if sd.get('background_image_style') is 'scaled':
|
if sd.get('background_image_style') is 'scaled':
|
||||||
iframe.style.backgroundSize = '100% 100%'
|
s.backgroundSize = '100% 100%'
|
||||||
iframe.style.backgroundRepeat = 'no-repeat'
|
s.backgroundRepeat = 'no-repeat'
|
||||||
iframe.style.backgroundAttachment = 'scroll'
|
s.backgroundAttachment = 'scroll'
|
||||||
iframe.style.backgroundPosition = 'center'
|
s.backgroundPosition = 'center'
|
||||||
else:
|
else:
|
||||||
iframe.style.backgroundSize = 'auto'
|
s.backgroundSize = 'auto'
|
||||||
iframe.style.backgroundRepeat = 'repeat'
|
s.backgroundRepeat = 'repeat'
|
||||||
iframe.style.backgroundAttachment = 'scroll'
|
s.backgroundAttachment = 'scroll'
|
||||||
iframe.style.backgroundPosition = '0 0'
|
s.backgroundPosition = '0 0'
|
||||||
|
|
||||||
self.content_popup_overlay.apply_color_scheme(ans.background, ans.foreground)
|
self.content_popup_overlay.apply_color_scheme(ans.background, ans.foreground)
|
||||||
self.book_scrollbar.apply_color_scheme(ans)
|
self.book_scrollbar.apply_color_scheme(ans)
|
||||||
# this is needed on iOS where the bottom margin has its own margin,
|
|
||||||
# so we don't want the body background color to bleed through
|
|
||||||
iframe.parentNode.style.backgroundColor = ans.background
|
|
||||||
iframe.parentNode.parentNode.style.backgroundColor = ans.background
|
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
def on_resize(self):
|
def on_resize(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user