mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
LONG_TAP_THRESHOLD was never used since the timer to check for it was using HOLD_THRESHOLD so just use HOLD_THRESHOLD
This commit is contained in:
parent
7b6f46df17
commit
4c928a6c30
@ -10,7 +10,6 @@ TAP_THRESHOLD = 8 # pixels
|
|||||||
SWIPE_THRESHOLD = 64 # pixels
|
SWIPE_THRESHOLD = 64 # pixels
|
||||||
TAP_LINK_THRESHOLD = 5 # pixels
|
TAP_LINK_THRESHOLD = 5 # pixels
|
||||||
PINCH_THRESHOLD = 20 # pixels
|
PINCH_THRESHOLD = 20 # pixels
|
||||||
LONG_TAP_THRESHOLD = 500 # milliseconds
|
|
||||||
|
|
||||||
gesture_id = 0
|
gesture_id = 0
|
||||||
|
|
||||||
@ -159,7 +158,7 @@ class TouchHandler:
|
|||||||
|
|
||||||
def start_hold_timer(self):
|
def start_hold_timer(self):
|
||||||
self.stop_hold_timer()
|
self.stop_hold_timer()
|
||||||
self.hold_timer = window.setTimeout(self.check_for_hold, 100)
|
self.hold_timer = window.setTimeout(self.check_for_hold, 50)
|
||||||
|
|
||||||
def stop_hold_timer(self):
|
def stop_hold_timer(self):
|
||||||
if self.hold_timer is not None:
|
if self.hold_timer is not None:
|
||||||
@ -243,7 +242,7 @@ class BookTouchHandler(TouchHandler):
|
|||||||
gesture.from_side_margin = self.for_side_margin
|
gesture.from_side_margin = self.for_side_margin
|
||||||
if gesture.type is 'tap':
|
if gesture.type is 'tap':
|
||||||
if gesture.is_held:
|
if gesture.is_held:
|
||||||
if not self.for_side_margin and not self.handled_tap_hold and window.performance.now() - gesture.start_time >= LONG_TAP_THRESHOLD:
|
if not self.for_side_margin and not self.handled_tap_hold and window.performance.now() - gesture.start_time >= HOLD_THRESHOLD:
|
||||||
self.handled_tap_hold = True
|
self.handled_tap_hold = True
|
||||||
gesture.type = 'long-tap'
|
gesture.type = 'long-tap'
|
||||||
get_boss().handle_gesture(gesture)
|
get_boss().handle_gesture(gesture)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user