mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Viewer: Add an option to have taps turn by screenfulls instead of pages, under Scrolling behavior
This commit is contained in:
parent
7141ebfafc
commit
0872338ae7
@ -627,9 +627,9 @@ def handle_gesture(gesture):
|
||||
if not gesture.active or gesture.is_held:
|
||||
scroll_by_page(gesture.direction is 'right', True)
|
||||
elif gesture.type is 'prev-page':
|
||||
scroll_by_page(True, False)
|
||||
scroll_by_page(True, opts.paged_taps_scroll_by_screen)
|
||||
elif gesture.type is 'next-page':
|
||||
scroll_by_page(False, False)
|
||||
scroll_by_page(False, opts.paged_taps_scroll_by_screen)
|
||||
elif gesture.type is 'long-tap':
|
||||
r = word_at_point(gesture.viewport_x, gesture.viewport_y)
|
||||
if r:
|
||||
|
@ -63,11 +63,13 @@ def create_scrolling_panel(container, apply_func, cancel_func):
|
||||
ans.valueAsNumber = sd.get(name, defaults[name])
|
||||
return E.label("for"=name, text), ans
|
||||
|
||||
container.appendChild(E.div(style='margin-top:1ex', _('Control how mouse based scrolling works in paged mode')))
|
||||
container.appendChild(E.div(style='margin-top:1ex', _('Control how scrolling works in paged mode')))
|
||||
container.appendChild(cb(
|
||||
'paged_wheel_scrolls_by_screen', _('Mouse wheel scrolls by screen fulls instead of pages')))
|
||||
container.appendChild(cb(
|
||||
'paged_margin_clicks_scroll_by_screen', _('Clicking on the margins scrolls by screen fulls instead of pages')))
|
||||
container.appendChild(cb(
|
||||
'paged_taps_scroll_by_screen', _('Tapping scrolls by screen fulls instead of pages')))
|
||||
|
||||
container.appendChild(E.hr())
|
||||
container.appendChild(E.div(style='margin-top:1ex', _('Control how smooth scrolling works in flow mode')))
|
||||
|
@ -24,6 +24,7 @@ def update_settings(settings):
|
||||
opts.margin_right = max(0, settings.margin_right)
|
||||
opts.override_book_colors = settings.override_book_colors
|
||||
opts.paged_wheel_scrolls_by_screen = v'!!settings.paged_wheel_scrolls_by_screen'
|
||||
opts.paged_taps_scroll_by_screen = v'!!settings.paged_taps_scroll_by_screen'
|
||||
opts.scroll_auto_boundary_delay = settings.scroll_auto_boundary_delay
|
||||
opts.scroll_stop_boundaries = v'!!settings.scroll_stop_boundaries'
|
||||
opts.user_stylesheet = settings.user_stylesheet
|
||||
|
@ -840,6 +840,7 @@ class View:
|
||||
'hide_tooltips': sd.get('hide_tooltips'),
|
||||
'cover_preserve_aspect_ratio': sd.get('cover_preserve_aspect_ratio'),
|
||||
'paged_wheel_scrolls_by_screen': sd.get('paged_wheel_scrolls_by_screen'),
|
||||
'paged_taps_scroll_by_screen': sd.get('paged_taps_scroll_by_screen'),
|
||||
'lines_per_sec_auto': sd.get('lines_per_sec_auto'),
|
||||
'lines_per_sec_smooth': sd.get('lines_per_sec_smooth'),
|
||||
'scroll_auto_boundary_delay': sd.get('scroll_auto_boundary_delay'),
|
||||
|
@ -50,6 +50,7 @@ defaults = {
|
||||
'override_book_colors': 'never',
|
||||
'paged_margin_clicks_scroll_by_screen': True,
|
||||
'paged_wheel_scrolls_by_screen': False,
|
||||
'paged_taps_scroll_by_screen': False,
|
||||
'read_mode': 'paged',
|
||||
'scroll_auto_boundary_delay': 5,
|
||||
'scroll_stop_boundaries': False,
|
||||
|
Loading…
x
Reference in New Issue
Block a user