mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Viewer: Set the classes calibre-viewer-paginated and calibre-viewer-scrolling on the <body> tag in Paged and Flow modes. This allows the User styles to target these modes, if needed. Fixes #1847427 [Request New Feature](https://bugs.launchpad.net/calibre/+bug/1847427)
This commit is contained in:
parent
6f09624280
commit
e2ded28390
@ -251,6 +251,7 @@ class IframeBoss:
|
||||
document.documentElement.style.overflow = 'hidden'
|
||||
if self.is_titlepage and not opts.cover_preserve_aspect_ratio:
|
||||
document.body.classList.add('cover-fill')
|
||||
document.body.classList.add(f'calibre-viewer-{window.navigator.epubReadingSystem.layoutStyle}')
|
||||
self.last_window_width, self.last_window_height = scroll_viewport.width(), scroll_viewport.height()
|
||||
apply_settings()
|
||||
self.fix_fullscreen_svg_images()
|
||||
|
@ -103,9 +103,12 @@ def create_user_stylesheet_panel(container, apply_func, cancel_func):
|
||||
_('A CSS style sheet that can be used to control the look and feel of the text. For examples, click'), ' ',
|
||||
E.a(class_='blue-link', title=_("Examples of user style sheets"),
|
||||
target=('_self' if runtime.is_standalone_viewer else '_blank'),
|
||||
href='https://www.mobileread.com/forums/showthread.php?t=51500', _('here'))
|
||||
href='https://www.mobileread.com/forums/showthread.php?t=51500', _('here.')),
|
||||
' ', _(
|
||||
'Note that you can use the selectors body.calibre-viewer-paginated and body.calibre-viewer-scrolling'
|
||||
' to target the Paged and Flow modes.')
|
||||
),
|
||||
E.textarea(name='user-stylesheet', style='width: 100%; margin-top: 1ex; box-sizing: border-box; flex-grow: 10')
|
||||
E.textarea(name='user-stylesheet', style='width: 100%; margin-top: 1ex; box-sizing: border-box; flex-grow: 10'),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user