Skip to content

Commit 9612407

Browse files
authored
Merge pull request #5437 from davep/bug/5436/fix-help-alignment
Don't pad a key's tooltip in the help panel if it doesn't have a description
2 parents ee4abfa + 59b09b0 commit 9612407

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Changed
1111

12+
### Fixed
13+
14+
- Fixed `Pilot.click` not working with `times` parameter https://github.com/Textualize/textual/pull/5398
15+
- Fixed select refocusing itself too late https://github.com/Textualize/textual/pull/5420
16+
- Fixed layout of the keys in the help panel when a key has a tooltip but no description https://github.com/Textualize/textual/issues/5436
17+
- Footer can now be scrolled horizontally without holding `shift` https://github.com/Textualize/textual/pull/5404
18+
- The content of an `Input` will now only be automatically selected when the widget is focused by the user, not when the app itself has regained focus (similar to web browsers). https://github.com/Textualize/textual/pull/5379
1219
- `Pilot.mouse_down` and `Pilot.mouse_up` now issue a prior `MouseMove` event, to more closely reflect real mouse actions. https://github.com/Textualize/textual/pull/5409
1320
- Snapshots tests now discard meta, which should reduce test breaking with no visual differences https://github.com/Textualize/textual/pull/5409
1421

@@ -141,7 +148,7 @@ the selection if there is one, otherwise it will cut the current line https://gi
141148
- Added `Widget.set_scroll` https://github.com/Textualize/textual/pull/5278
142149
- Added `Select.selection` https://github.com/Textualize/textual/pull/5278
143150

144-
### Fixed
151+
### Fixed
145152

146153
- Fixed offset applied to docked widgets https://github.com/Textualize/textual/pull/5264
147154
- Fixed loading widgets responding to input https://github.com/Textualize/textual/pull/5267
@@ -417,7 +424,7 @@ the selection if there is one, otherwise it will cut the current line https://gi
417424

418425
### Changed
419426

420-
- Removed caps_lock and num_lock modifiers https://github.com/Textualize/textual/pull/4861
427+
- Removed caps_lock and num_lock modifiers https://github.com/Textualize/textual/pull/4861
421428
- Keys such as escape and space are now displayed in lower case in footer https://github.com/Textualize/textual/pull/4876
422429
- Changed default command palette binding to `ctrl+p` https://github.com/Textualize/textual/pull/4867
423430
- Removed `ctrl_to_caret` and `upper_case_keys` from Footer. These can be implemented in `App.get_key_display`.
@@ -624,7 +631,7 @@ when an expandable node is selected https://github.com/Textualize/textual/pull/4
624631

625632
### Added
626633

627-
- Added `Screen.is_active`
634+
- Added `Screen.is_active`
628635
- Added `icon` reactive to Header widget https://github.com/Textualize/textual/pull/4627
629636
- Added `time_format` reactive to Header widget https://github.com/Textualize/textual/pull/4627
630637
- Added `tooltip` parameter to input widgets https://github.com/Textualize/textual/pull/4625

src/textual/widgets/_key_panel.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def render_description(binding: Binding) -> Text:
8686
binding.description, end="", style=description_style
8787
)
8888
if binding.tooltip:
89-
text.append(" ")
89+
if binding.description:
90+
text.append(" ")
9091
text.append(binding.tooltip, "dim")
9192
return text
9293

@@ -119,19 +120,19 @@ class KeyPanel(VerticalScroll, can_focus=False):
119120
"""
120121

121122
DEFAULT_CSS = """
122-
KeyPanel {
123+
KeyPanel {
123124
split: right;
124125
width: 33%;
125-
min-width: 30;
126-
max-width: 60;
126+
min-width: 30;
127+
max-width: 60;
127128
border-left: vkey $foreground 30%;
128129
padding: 0 1;
129130
height: 1fr;
130131
padding-right: 1;
131132
align: center top;
132133
133134
&> BindingsTable > .bindings-table--key {
134-
color: $accent;
135+
color: $accent;
135136
text-style: bold;
136137
padding: 0 1;
137138
}
@@ -151,7 +152,7 @@ class KeyPanel(VerticalScroll, can_focus=False):
151152
#bindings-table {
152153
width: auto;
153154
height: auto;
154-
}
155+
}
155156
}
156157
"""
157158

0 commit comments

Comments
 (0)