Skip to content

Commit

Permalink
simplify by removing now unnecessary if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
TomJGooding committed Jun 21, 2024
1 parent 36ecb04 commit 1cf34fd
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions src/textual/widgets/_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,14 @@ def render(self) -> Text:
if self.ctrl_to_caret and key_display.lower().startswith("ctrl+"):
key_display = "^" + key_display.split("+", 1)[1]
description = self.description
if self.compact:
label_text = Text.assemble(
(
" " * key_padding.left + key_display + " " * key_padding.right,
key_style,
),
" " * key_margin.right,
(description, description_style),
)
else:
label_text = Text.assemble(
(
" " * key_padding.left + key_display + " " * key_padding.right,
key_style,
),
" " * key_margin.right,
(description, description_style),
)
label_text = Text.assemble(
(
" " * key_padding.left + key_display + " " * key_padding.right,
key_style,
),
" " * key_margin.right,
(description, description_style),
)
label_text.stylize_before(self.rich_style)
return label_text

Expand Down

0 comments on commit 1cf34fd

Please sign in to comment.