misc cleanups for RTL merge

This commit is contained in:
Kovid Goyal 2020-07-27 15:20:51 +05:30
parent a681d71608
commit 0848740051
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 7 additions and 5 deletions

View File

@ -121,6 +121,7 @@ def flow_onwheel(evt):
def goto_boundary(dir): def goto_boundary(dir):
scroll_viewport.scroll_to(scroll_viewport.x(), 0 if dir is DIRECTION.Up else document_height()) scroll_viewport.scroll_to(scroll_viewport.x(), 0 if dir is DIRECTION.Up else document_height())
get_boss().report_human_scroll() get_boss().report_human_scroll()
return False
@check_for_scroll_end_and_report @check_for_scroll_end_and_report
@ -132,6 +133,7 @@ def scroll_by_page(direction, flip_if_rtl_page_progression):
# the progression direction. # the progression direction.
return flip_if_rtl_page_progression and rtl_page_progression() return flip_if_rtl_page_progression and rtl_page_progression()
def scroll_to_extend_annotation(backward, horizontal, by_page): def scroll_to_extend_annotation(backward, horizontal, by_page):
direction = -1 if backward else 1 direction = -1 if backward else 1
h = line_height() h = line_height()

View File

@ -584,7 +584,7 @@ onwheel = wheel_handler.onwheel.bind(wheel_handler)
def scroll_by_page(backward, by_screen, flip_if_rtl_page_progression): def scroll_by_page(backward, by_screen, flip_if_rtl_page_progression):
if (flip_if_rtl_page_progression and rtl_page_progression()): if flip_if_rtl_page_progression and rtl_page_progression():
backward = not backward backward = not backward
if by_screen: if by_screen:

View File

@ -92,9 +92,9 @@ def apply_colors():
# it is not displayed properly when scrolling unless overflow:visible is set, # it is not displayed properly when scrolling unless overflow:visible is set,
# but this causes scrollbars to appear. # but this causes scrollbars to appear.
# Force disable scrollbars in Chrome, Safari, and Firefox to address this side effect. # Force disable scrollbars in Chrome, Safari, and Firefox to address this side effect.
text += '\nhtml::-webkit-scrollbar, body::-webkit-scrollbar { display: none }' text += '\nhtml::-webkit-scrollbar, body::-webkit-scrollbar { display: none !important }'
text += '\nhtml { scrollbar-width: none; }' # for firefox: https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-width
text += '\nbody { scrollbar-width: none; }' text += '\nhtml, body { scrollbar-width: none !important }'
ss.textContent = text ss.textContent = text

View File

@ -248,7 +248,7 @@ class BookTouchHandler(TouchHandler):
if gesture.viewport_y < min(100, scroll_viewport.height() / 4): if gesture.viewport_y < min(100, scroll_viewport.height() / 4):
gesture.type = 'show-chrome' gesture.type = 'show-chrome'
else: else:
# Calibre's default, books that go left to right. # default, books that go left to right.
if ltr_page_progression(): if ltr_page_progression():
if gesture.viewport_x < min(100, scroll_viewport.width() / 4): if gesture.viewport_x < min(100, scroll_viewport.width() / 4):
gesture.type = 'prev-page' gesture.type = 'prev-page'