From 0848740051071ed64b07bfc6de4395602bc1854a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 27 Jul 2020 15:20:51 +0530 Subject: [PATCH] misc cleanups for RTL merge --- src/pyj/read_book/flow_mode.pyj | 2 ++ src/pyj/read_book/paged_mode.pyj | 2 +- src/pyj/read_book/settings.pyj | 6 +++--- src/pyj/read_book/touch.pyj | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pyj/read_book/flow_mode.pyj b/src/pyj/read_book/flow_mode.pyj index c3a9ab8052..0840002aa6 100644 --- a/src/pyj/read_book/flow_mode.pyj +++ b/src/pyj/read_book/flow_mode.pyj @@ -121,6 +121,7 @@ def flow_onwheel(evt): def goto_boundary(dir): scroll_viewport.scroll_to(scroll_viewport.x(), 0 if dir is DIRECTION.Up else document_height()) get_boss().report_human_scroll() + return False @check_for_scroll_end_and_report @@ -132,6 +133,7 @@ def scroll_by_page(direction, flip_if_rtl_page_progression): # the progression direction. return flip_if_rtl_page_progression and rtl_page_progression() + def scroll_to_extend_annotation(backward, horizontal, by_page): direction = -1 if backward else 1 h = line_height() diff --git a/src/pyj/read_book/paged_mode.pyj b/src/pyj/read_book/paged_mode.pyj index 7493cfd37e..6fb157d972 100644 --- a/src/pyj/read_book/paged_mode.pyj +++ b/src/pyj/read_book/paged_mode.pyj @@ -584,7 +584,7 @@ onwheel = wheel_handler.onwheel.bind(wheel_handler) 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 if by_screen: diff --git a/src/pyj/read_book/settings.pyj b/src/pyj/read_book/settings.pyj index fe46d4edb1..9f960fbeab 100644 --- a/src/pyj/read_book/settings.pyj +++ b/src/pyj/read_book/settings.pyj @@ -92,9 +92,9 @@ def apply_colors(): # it is not displayed properly when scrolling unless overflow:visible is set, # but this causes scrollbars to appear. # Force disable scrollbars in Chrome, Safari, and Firefox to address this side effect. - text += '\nhtml::-webkit-scrollbar, body::-webkit-scrollbar { display: none }' - text += '\nhtml { scrollbar-width: none; }' - text += '\nbody { scrollbar-width: none; }' + text += '\nhtml::-webkit-scrollbar, body::-webkit-scrollbar { display: none !important }' + # for firefox: https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-width + text += '\nhtml, body { scrollbar-width: none !important }' ss.textContent = text diff --git a/src/pyj/read_book/touch.pyj b/src/pyj/read_book/touch.pyj index b114bce521..b80742f3cb 100644 --- a/src/pyj/read_book/touch.pyj +++ b/src/pyj/read_book/touch.pyj @@ -248,7 +248,7 @@ class BookTouchHandler(TouchHandler): if gesture.viewport_y < min(100, scroll_viewport.height() / 4): gesture.type = 'show-chrome' else: - # Calibre's default, books that go left to right. + # default, books that go left to right. if ltr_page_progression(): if gesture.viewport_x < min(100, scroll_viewport.width() / 4): gesture.type = 'prev-page'