From e7fc99606a81121d19a542b8aed5108016aba0de Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Wed, 22 May 2024 21:42:58 +0100 Subject: [PATCH 1/3] fix(footer): ignore multi bindings for grid size --- src/textual/widgets/_footer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textual/widgets/_footer.py b/src/textual/widgets/_footer.py index 694835e731..b80a1559ec 100644 --- a/src/textual/widgets/_footer.py +++ b/src/textual/widgets/_footer.py @@ -141,7 +141,7 @@ def compose(self) -> ComposeResult: for binding, enabled in bindings: action_to_bindings[binding.action].append((binding, enabled)) - self.styles.grid_size_columns = len(bindings) + self.styles.grid_size_columns = len(action_to_bindings) for multi_bindings in action_to_bindings.values(): binding, enabled = multi_bindings[0] yield FooterKey( From 2355be05ff4de21cfdf2bf47c1a0abdb933f3c9d Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Wed, 22 May 2024 21:48:58 +0100 Subject: [PATCH 2/3] clean trailing whitespace --- src/textual/widgets/_footer.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/textual/widgets/_footer.py b/src/textual/widgets/_footer.py index b80a1559ec..f1a5d1f281 100644 --- a/src/textual/widgets/_footer.py +++ b/src/textual/widgets/_footer.py @@ -23,36 +23,36 @@ class FooterKey(Widget): FooterKey { width: auto; height: 1; - background: $panel; - color: $text-muted; - .footer-key--key { - color: $secondary; + background: $panel; + color: $text-muted; + .footer-key--key { + color: $secondary; background: $panel; - text-style: bold; + text-style: bold; } &:light .footer-key--key { - color: $primary; - } + color: $primary; + } &:hover { background: $panel-darken-2; color: $text; - .footer-key--key { - background: $panel-darken-2; - } + .footer-key--key { + background: $panel-darken-2; + } } - &.-disabled { + &.-disabled { text-style: dim; background: $panel; &:hover { - .footer-key--key { + .footer-key--key { background: $panel; - } - } + } + } } - + } """ @@ -110,7 +110,7 @@ class Footer(ScrollableContainer, can_focus=False, can_focus_children=False): DEFAULT_CSS = """ Footer { layout: grid; - grid-columns: auto; + grid-columns: auto; background: $panel; color: $text; dock: bottom; @@ -118,7 +118,7 @@ class Footer(ScrollableContainer, can_focus=False, can_focus_children=False): scrollbar-size: 0 0; &.-compact { grid-gutter: 1; - } + } } """ From ce004248ea54f3ba94aedd9e8e0f4d64e9376001 Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Wed, 22 May 2024 21:59:54 +0100 Subject: [PATCH 3/3] update changlog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6091cedce0..3685939f50 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 + +- Fixed `Footer` grid size https://github.com/Textualize/textual/pull/4545 + ## [0.63.1] - 2024-05-22 ### Fixed