Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(footer): exclude multi bindings for grid size #4545

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.2] - 2024-05-23

### Fixed
Expand Down
36 changes: 18 additions & 18 deletions src/textual/widgets/_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
}

}
"""

Expand Down Expand Up @@ -110,15 +110,15 @@ 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;
height: 1;
scrollbar-size: 0 0;
&.-compact {
grid-gutter: 1;
}
}
}
"""

Expand All @@ -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(
Expand Down
Loading