Skip to content
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

Merged
merged 32 commits into from
Mar 2, 2023
Merged

Fix content width #1910

merged 32 commits into from
Mar 2, 2023

Conversation

willmcgugan
Copy link
Collaborator

@willmcgugan willmcgugan commented Mar 1, 2023

Fixes #1904
Fixes #1920

@willmcgugan willmcgugan marked this pull request as draft March 1, 2023 10:46
@willmcgugan willmcgugan marked this pull request as ready for review March 1, 2023 10:58
@willmcgugan willmcgugan marked this pull request as draft March 1, 2023 11:12
@willmcgugan willmcgugan marked this pull request as ready for review March 1, 2023 13:45
@@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Comment on lines 983 to 982
show_horizontal = self.show_horizontal_scrollbar
show_horizontal = False
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Comment on lines 518 to 519
self._stabilized_scrollbar_size = None
self._scrollbar_stabilizer = 0
Copy link
Contributor

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=["_"])
Copy link
Contributor

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.

@willmcgugan willmcgugan marked this pull request as draft March 2, 2023 13:50
@willmcgugan willmcgugan marked this pull request as ready for review March 2, 2023 14:33
@willmcgugan willmcgugan merged commit 41003e3 into main Mar 2, 2023
@willmcgugan willmcgugan deleted the fix-content-width branch March 2, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants