Skip to content

Commit

Permalink
Tidy up the docstring of Widget.scroll_to
Browse files Browse the repository at this point in the history
Delivering on a promise made in Textualize#1920.
  • Loading branch information
davep committed Mar 1, 2023
1 parent abdcf2f commit 21e7cfb
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1436,17 +1436,16 @@ def scroll_to(
"""Scroll to a given (absolute) coordinate, optionally animating.
Args:
x: X coordinate (column) to scroll to, or None for no change. Defaults to None.
y: Y coordinate (row) to scroll to, or None for no change. Defaults to None.
animate: Animate to new scroll position. Defaults to True.
speed: Speed of scroll if animate is True. Or None to use duration.
duration: Duration of animation, if animate is True and speed is None.
easing: An easing method for the scrolling animation. Defaults to "None",
which will result in Textual choosing the default scrolling easing function.
x: X coordinate (column) to scroll to, or `None` for no change.
y: Y coordinate (row) to scroll to, or `None` for no change.
animate: Animate to new scroll position.
speed: Speed of scroll if `animate` is `True`. Or `None` to use duration.
duration: Duration of animation, if `animate` is `True` and speed is `None`.
easing: An easing method for the scrolling animation.
force: Force scrolling even when prohibited by overflow styling. Defaults to `False`.
Returns:
True if the scroll position changed, otherwise False.
`True` if the scroll position changed, otherwise `False`.
"""
maybe_scroll_x = x is not None and (self.allow_horizontal_scroll or force)
maybe_scroll_y = y is not None and (self.allow_vertical_scroll or force)
Expand Down

0 comments on commit 21e7cfb

Please sign in to comment.