mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
E-book viewer: Fix scrollbar position not updating during continuous scroll. Fixes #2077801 [[Enhancement] Ebook-viewer: scrollbar slider position should be updated when scrolling the text](https://bugs.launchpad.net/calibre/+bug/2077801)
This commit is contained in:
parent
e80fdf55b7
commit
000391f8d0
@ -104,10 +104,13 @@ class BookScrollbar:
|
|||||||
frac = max(0, min(frac, 1))
|
frac = max(0, min(frac, 1))
|
||||||
c.firstChild.style.top = f'{frac * (c.clientHeight - c.firstChild.clientHeight)}px'
|
c.firstChild.style.top = f'{frac * (c.clientHeight - c.firstChild.clientHeight)}px'
|
||||||
|
|
||||||
|
def _sync_to_contents(self, frac):
|
||||||
|
self.sync_to_contents_timer = 0
|
||||||
|
self.set_position(frac)
|
||||||
|
|
||||||
def sync_to_contents(self, frac):
|
def sync_to_contents(self, frac):
|
||||||
if self.sync_to_contents_timer:
|
if not self.sync_to_contents_timer:
|
||||||
window.clearTimeout(self.sync_to_contents_timer)
|
self.sync_to_contents_timer = window.setTimeout(self._sync_to_contents.bind(None, frac), 50)
|
||||||
self.sync_to_contents_timer = window.setTimeout(self.set_position.bind(None, frac), 100)
|
|
||||||
|
|
||||||
def apply_color_scheme(self, colors):
|
def apply_color_scheme(self, colors):
|
||||||
fg = cached_color_to_rgba(colors.foreground)
|
fg = cached_color_to_rgba(colors.foreground)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user