Fix #1926209 [[Enhancement - Viewer] Add Miscellous heading for option in preferences](https://bugs.launchpad.net/calibre/+bug/1926209)

This commit is contained in:
Kovid Goyal 2021-04-27 07:45:04 +05:30
parent 9eecc783f0
commit 66bcc9efc8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -51,10 +51,10 @@ def create_scrolling_panel(container, apply_func, cancel_func):
sd = get_session_data()
def cb(name, text):
ans = E.input(type='checkbox', name=name)
ans = E.input(type='checkbox', name=name, style='margin-left: 0')
if sd.get(name):
ans.checked = True
return E.div(style='margin-top:1ex', E.label(ans, '\xa0' + text))
return E.div(style='margin-top:1ex', E.label(ans, text))
def spinner(name, text, **kwargs):
ans = E.input(type='number', name=name, id=name)
@ -64,17 +64,18 @@ def create_scrolling_panel(container, apply_func, cancel_func):
return E.label("for"=name, text), ans
container.appendChild(E.div(style='margin-top:1ex', _('Control how scrolling works in paged mode')))
container.appendChild(cb(
container.appendChild(E.div(style='margin-left: 1rem'))
container.lastChild.appendChild(cb(
'paged_wheel_scrolls_by_screen', _('Mouse wheel scrolls by screen fulls instead of pages')))
container.appendChild(cb(
container.lastChild.appendChild(cb(
'paged_margin_clicks_scroll_by_screen', _('Clicking on the margins scrolls by screen fulls instead of pages')))
container.appendChild(cb(
container.lastChild.appendChild(cb(
'paged_taps_scroll_by_screen', _('Tapping scrolls by screen fulls instead of pages')))
container.appendChild(
container.lastChild.appendChild(
E.div(style='display:grid;margin-top:1ex;align-items:center;grid-template-columns:auto min-content;grid-gap:1ex; max-width: 30em',
*spinner(
'paged_pixel_scroll_threshold',
_('Pixel scroll threshold:'),
'\xa0' + _('Pixel scroll threshold:'),
title=_('When using a touchpad or mouse wheel that produces scroll events in pixels, set the number of pixels before a page turn is triggered'),
step=5,
min=0,
@ -84,11 +85,12 @@ def create_scrolling_panel(container, apply_func, cancel_func):
container.appendChild(E.hr())
container.appendChild(E.div(style='margin-top:1ex', _('Control how smooth scrolling works in flow mode')))
container.appendChild(cb(
container.appendChild(E.div(style='margin-left: 1rem'))
container.lastChild.appendChild(cb(
'scroll_stop_boundaries',
_('Stop at internal file boundaries when smooth scrolling by holding down the scroll key')
))
container.appendChild(
container.lastChild.appendChild(
E.div(style='display:grid;margin-top:1ex;align-items:center;grid-template-columns:auto min-content;grid-gap:1ex; max-width: 30em',
*spinner(
'lines_per_sec_smooth',
@ -116,7 +118,9 @@ def create_scrolling_panel(container, apply_func, cancel_func):
)
container.appendChild(E.hr())
container.appendChild(cb('book_scrollbar', _('Show a scrollbar')))
container.appendChild(E.div(style='margin-top:1ex', _('Miscellaneous')))
container.appendChild(E.div(style='margin-left: 1rem'))
container.lastChild.appendChild(cb('book_scrollbar', _('Show a scrollbar')))
container.appendChild(create_button_box(restore_defaults, apply_func, cancel_func))