mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
misc cleanups for RTL merge
This commit is contained in:
parent
a681d71608
commit
0848740051
@ -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()
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user