From 0455564f801c21b91179c35c0bfd0c1780d594c2 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 15 Feb 2023 11:41:26 +0000 Subject: [PATCH 1/3] Ensure scrollbars update when show_header toggles --- src/textual/widgets/_data_table.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/textual/widgets/_data_table.py b/src/textual/widgets/_data_table.py index 3a3d5e100..203936e71 100644 --- a/src/textual/widgets/_data_table.py +++ b/src/textual/widgets/_data_table.py @@ -786,7 +786,11 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True): elif self.cursor_type == "column": self._highlight_column(self.cursor_column) - def watch_show_header(self) -> None: + def watch_show_header(self, show: bool) -> None: + width, height = self.virtual_size + height_change = self.header_height if show else -self.header_height + self.virtual_size = Size(width, height + height_change) + self._scroll_cursor_into_view() self._clear_caches() def watch_fixed_rows(self) -> None: From e9200a450f124d553aeaf44042ae6022872da844 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 15 Feb 2023 11:46:41 +0000 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b83ccf89..9da52b51e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## Unreleased + +### Fixed + +- DataTable scrollbars resize correctly when header is toggled https://github.com/Textualize/textual/pull/1803 + ## [0.11.0] - 2023-02-15 ### Added From 9ca79d8b020c3ceb7e986b5d1fcf4f3af86919dd Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 16 Feb 2023 08:47:11 +0000 Subject: [PATCH 3/3] Removed unused variable from _merge_bindings --- src/textual/dom.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/textual/dom.py b/src/textual/dom.py index 24a1b7b1d..77fc6c76d 100644 --- a/src/textual/dom.py +++ b/src/textual/dom.py @@ -260,9 +260,6 @@ class DOMNode(MessagePump): """ bindings: list[Bindings] = [] - # To start with, assume that bindings won't be priority bindings. - priority = False - for base in reversed(cls.__mro__): if issubclass(base, DOMNode): if not base._inherit_bindings: