-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix content width #1910
Fix content width #1910
Conversation
@@ -82,7 +82,7 @@ def _size_updated( | |||
Returns: | |||
True if anything changed, or False if nothing changed. | |||
""" | |||
if self._size != size or container_size != container_size: | |||
if self._size != size or self._container_size != container_size: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
src/textual/widget.py
Outdated
show_horizontal = self.show_horizontal_scrollbar | ||
show_horizontal = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you help me understand why the default behaviour is to turn off show_horizontal
instead of leaving the previous value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous value shouldn't come in to consideration. It should make the same calculation, no matter the current state of the scrollbars.
src/textual/widget.py
Outdated
self._stabilized_scrollbar_size = None | ||
self._scrollbar_stabilizer = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding docstrings to these two attributes.
self._stabilized_scrollbar_size
is already typed in the body of Widget
but _scrollbar_stabilizer
is brand new.
|
||
|
||
def test_line_api_scrollbars(snap_compare): | ||
assert snap_compare(SNAPSHOT_APPS_DIR / "test_line_api_scrollbars.py", press=["_"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The app examples in snapshot_apps
don't have the leading test_
in their names.
I don't think this will break anything, but it may create the expectation (for humans and for pytest
) that there are tests written in this file.
Fixes #1904
Fixes #1920