From 21e7cfb9ca62915eab180f3e29bfc94130f4d509 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Wed, 1 Mar 2023 14:17:01 +0000 Subject: [PATCH] Tidy up the docstring of Widget.scroll_to Delivering on a promise made in #1920. --- src/textual/widget.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/textual/widget.py b/src/textual/widget.py index ad26fb9a74..2d2b915f73 100644 --- a/src/textual/widget.py +++ b/src/textual/widget.py @@ -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)