mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
fix scrollbar thumb height
This commit is contained in:
@@ -112,10 +112,6 @@ class ScrollBarRender:
|
||||
|
||||
thumb_size = window_size / step_size * len_bars
|
||||
|
||||
if thumb_size < len_bars:
|
||||
virtual_size += step_size
|
||||
step_size = virtual_size / size
|
||||
|
||||
start = int(position / step_size * len_bars)
|
||||
end = start + max(len_bars, ceil(thumb_size))
|
||||
|
||||
|
||||
@@ -2664,6 +2664,7 @@ class Widget(DOMNode):
|
||||
self._check_refresh()
|
||||
|
||||
def _check_refresh(self) -> None:
|
||||
"""Check if a refresh was requested."""
|
||||
if self._parent is not None and not self._closing:
|
||||
try:
|
||||
screen = self.screen
|
||||
|
||||
@@ -334,3 +334,9 @@ def test_tabs_invalidate(snap_compare):
|
||||
SNAPSHOT_APPS_DIR / "tabs_invalidate.py",
|
||||
press=["tab", "right"],
|
||||
)
|
||||
|
||||
|
||||
def test_scrollbar_thumb_height(snap_compare):
|
||||
assert snap_compare(
|
||||
SNAPSHOT_APPS_DIR / "scrollbar_thumb_height.py",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user