better name for two finger tap gesture

This commit is contained in:
Kovid Goyal 2023-06-09 15:28:02 +05:30
parent e0d2c5cfcf
commit 0acd1a8182
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 3 deletions

View File

@ -317,6 +317,8 @@ class IframeBoss:
def handle_gesture(self, gesture): def handle_gesture(self, gesture):
if gesture.type is 'show-chrome': if gesture.type is 'show-chrome':
self.send_message('show_chrome') self.send_message('show_chrome')
elif gesture.type is 'two-finger-tap':
self.send_message('show_chrome')
elif gesture.type is 'pinch': elif gesture.type is 'pinch':
self.send_message('bump_font_size', increase=gesture.direction is 'out') self.send_message('bump_font_size', increase=gesture.direction is 'out')
elif gesture.type is 'long-tap': elif gesture.type is 'long-tap':

View File

@ -82,7 +82,7 @@ def interpret_double_gesture(touch1, touch2, gesture_id):
max_y_displacement1 = max_displacement(touch1.viewport_y) max_y_displacement1 = max_displacement(touch1.viewport_y)
max_y_displacement2 = max_displacement(touch2.viewport_y) max_y_displacement2 = max_displacement(touch2.viewport_y)
if max(max_x_displacement1, max_y_displacement1) < TAP_THRESHOLD and max(max_x_displacement2, max_y_displacement2) < TAP_THRESHOLD: if max(max_x_displacement1, max_y_displacement1) < TAP_THRESHOLD and max(max_x_displacement2, max_y_displacement2) < TAP_THRESHOLD:
ans.type = 'double-tap' ans.type = 'two-finger-tap'
ans.viewport_x1 = touch1.viewport_x[0] ans.viewport_x1 = touch1.viewport_x[0]
ans.viewport_y1 = touch1.viewport_y[0] ans.viewport_y1 = touch1.viewport_y[0]
ans.viewport_x2 = touch2.viewport_x[0] ans.viewport_x2 = touch2.viewport_x[0]
@ -288,10 +288,9 @@ class BookTouchHandler(TouchHandler):
if gesture.type is 'pinch': if gesture.type is 'pinch':
if gesture.active: if gesture.active:
return return
if gesture.type is 'double-tap': if gesture.type is 'two-finger-tap':
if gesture.active: if gesture.active:
return return
gesture.type = 'show-chrome'
if self.for_side_margin: if self.for_side_margin:
ui_operations.forward_gesture(gesture) ui_operations.forward_gesture(gesture)
else: else: