mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make scrollbar sync to contents use last reported position
This commit is contained in:
parent
55898fcfaa
commit
d2320b6505
@ -104,13 +104,14 @@ class BookScrollbar:
|
||||
frac = max(0, min(frac, 1))
|
||||
c.firstChild.style.top = f'{frac * (c.clientHeight - c.firstChild.clientHeight)}px'
|
||||
|
||||
def _sync_to_contents(self, frac):
|
||||
def _sync_to_contents(self):
|
||||
self.sync_to_contents_timer = 0
|
||||
self.set_position(frac)
|
||||
self.set_position(self.sync_to_contents_frac)
|
||||
|
||||
def sync_to_contents(self, frac):
|
||||
self.sync_to_contents_frac = frac
|
||||
if not 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._sync_to_contents, 50)
|
||||
|
||||
def apply_color_scheme(self, colors):
|
||||
fg = cached_color_to_rgba(colors.foreground)
|
||||
|
Loading…
x
Reference in New Issue
Block a user