mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Handle swiping in flow mode
This commit is contained in:
parent
725b0067ae
commit
6f93debe6e
@ -100,4 +100,12 @@ def layout(is_single_page):
|
||||
set_css(document.body, margin='0', border_width='0', padding='0')
|
||||
|
||||
def handle_gesture(gesture):
|
||||
pass
|
||||
if gesture.type is 'swipe':
|
||||
if gesture.points.length > 1 and not gesture.is_held:
|
||||
delta = gesture.points[-2] - gesture.points[-1]
|
||||
if gesture.axis is 'vertical':
|
||||
scroll_by(delta)
|
||||
else:
|
||||
window.scrollBy(delta, 0)
|
||||
if not gesture.active:
|
||||
print('TODO: Implement momentum scrolling')
|
||||
|
Loading…
x
Reference in New Issue
Block a user