Remove default scrollbars from Container

As per #2361 this removes default scrollbars on Container (and so adds them
on ScrollableContainer).
This commit is contained in:
Dave Pearson
2023-04-24 11:06:31 +01:00
parent 8b6d9027e9
commit 38e636921c

View File

@@ -18,7 +18,7 @@ class Container(Widget):
Container { Container {
height: 1fr; height: 1fr;
layout: vertical; layout: vertical;
overflow: auto; overflow: hidden hidden;
} }
""" """
@@ -26,6 +26,13 @@ class Container(Widget):
class ScrollableContainer(Widget, inherit_bindings=False): class ScrollableContainer(Widget, inherit_bindings=False):
"""Base container widget that binds navigation keys for scrolling.""" """Base container widget that binds navigation keys for scrolling."""
DEFAULT_CSS = """
ScrollableContainer {
layout: vertical;
overflow: auto auto;
}
"""
BINDINGS: ClassVar[list[BindingType]] = [ BINDINGS: ClassVar[list[BindingType]] = [
Binding("up", "scroll_up", "Scroll Up", show=False), Binding("up", "scroll_up", "Scroll Up", show=False),
Binding("down", "scroll_down", "Scroll Down", show=False), Binding("down", "scroll_down", "Scroll Down", show=False),