aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lvc/widgets/tablescroll.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/lvc/widgets/tablescroll.py b/lvc/widgets/tablescroll.py
index f8b1acb..37e1259 100644
--- a/lvc/widgets/tablescroll.py
+++ b/lvc/widgets/tablescroll.py
@@ -72,12 +72,16 @@ class ScrollbarOwnerMixin(object):
return
# We just tried and failed; schedule a retry when the scrollable
# range changes.
- self._scroll_to_iter_callback = self.connect('scroll-range-changed',
- lambda *a: self.scroll_to_iter(iter_, manual, recenter))
+ self._scroll_to_iter_callback = \
+ self.connect('scroll-range-changed',
+ lambda *a: self.scroll_to_iter(iter_,
+ manual,
+ recenter))
return
- # If the above succeeded, we know the iter's position; this means we can
- # set_scroll_position to that position. That may work now or be
- # postponed until later, but either way we're done with scroll_to_iter.
+ # If the above succeeded, we know the iter's position;
+ # this means we can set_scroll_position to that position.
+ # That may work now or be postponed until later,
+ # but either way we're done with scroll_to_iter.
if self._scroll_to_iter_callback:
self.disconnect(self._scroll_to_iter_callback)
self._scroll_to_iter_callback = None
@@ -95,7 +99,7 @@ class ScrollbarOwnerMixin(object):
# possible; this may or may not be now, but our work here is done.
def set_scroll_position(self, position, restore_only=False,
- _hack_for_17153=False):
+ _hack_for_17153=False):
"""Scroll the top left corner to the given (x, y) offset from the origin
of the view.
@@ -108,12 +112,13 @@ class ScrollbarOwnerMixin(object):
@classmethod
def _should_scroll(cls,
- manual, in_top, in_bottom, recenter, manually_scrolled):
+ manual, in_top, in_bottom, recenter, manually_scrolled):
if not manual and manually_scrolled:
# The user has moved the scrollbars since we last autoscrolled, and
# we're deciding whether we should resume autoscrolling.
# We want to do that when the currently-playing item catches up to
- # the center of the screen i.e. is part above the center, part below
+ # the center of the screen.
+ # i.e. is part above the center, part below
return in_top and in_bottom
# This is a manual scroll, or we're already autoscrolling - so we no
# longer need to worry about either manual or manually_scrolled
@@ -123,7 +128,8 @@ class ScrollbarOwnerMixin(object):
return recenter
if in_bottom:
# We land here when:
- # - playback has begun with an item in the bottom half of the screen
+ # - playback has begun with an item
+ # in the bottom half of the screen
# - scroll is following sequential playback
# Either way we want to jump down to the item.
return True