diff --git a/sandbox/will/scroll.py b/sandbox/will/scroll.py deleted file mode 100644 index d4b102201..000000000 --- a/sandbox/will/scroll.py +++ /dev/null @@ -1,44 +0,0 @@ -from textual import layout, events -from textual.app import App, ComposeResult -from textual.widgets import Button - - -class ButtonsApp(App[str]): - def compose(self) -> ComposeResult: - yield layout.Vertical( - Button("default", id="foo"), - Button("Where there is a Will"), - Button("There is a Way"), - Button("There can be only one"), - Button.success("success", id="bar"), - layout.Horizontal( - Button("Where there is a Will"), - Button("There is a Way"), - Button("There can be only one"), - Button.warning("warning", id="baz"), - Button("Where there is a Will"), - Button("There is a Way"), - Button("There can be only one"), - id="scroll", - ), - Button.error("error", id="baz"), - Button("Where there is a Will"), - Button("There is a Way"), - Button("There can be only one"), - ) - - def on_button_pressed(self, event: Button.Pressed) -> None: - self.app.bell() - - async def on_key(self, event: events.Key) -> None: - await self.dispatch_key(event) - - def key_d(self): - self.dark = not self.dark - - -app = ButtonsApp(log_path="textual.log", css_path="buttons.css", watch_css=True) - -if __name__ == "__main__": - result = app.run() - print(repr(result)) diff --git a/src/textual/widget.py b/src/textual/widget.py index d48aa5f76..dcd079091 100644 --- a/src/textual/widget.py +++ b/src/textual/widget.py @@ -498,8 +498,6 @@ class Widget(DOMNode): overflow_y = styles.overflow_y width, height = self.container_size - previous_show_vertical = self.show_vertical_scrollbar - show_horizontal = self.show_horizontal_scrollbar if overflow_x == "hidden": show_horizontal = False @@ -516,16 +514,6 @@ class Widget(DOMNode): elif overflow_y == "auto": show_vertical = self.virtual_size.height > height - # if ( - # not previous_show_vertical - # and show_vertical - # and show_horizontal - # and overflow_x == "auto" - # ): - # show_horizontal = ( - # self.virtual_size.width - styles.scrollbar_size_vertical > width - # ) - self.show_horizontal_scrollbar = show_horizontal self.show_vertical_scrollbar = show_vertical self.horizontal_scrollbar.display = show_horizontal @@ -909,8 +897,6 @@ class Widget(DOMNode): scroll_y = self.scroll_y self.scroll_target_y = self.scroll_y = y scrolled_y = scroll_y != self.scroll_y - # if scrolled_x or scrolled_y: - # self.refresh(repaint=False, layout=False) return scrolled_x or scrolled_y