-
Notifications
You must be signed in to change notification settings - Fork 823
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(footer): enable padding between key and description
- Loading branch information
1 parent
e9ad400
commit f83a905
Showing
4 changed files
with
214 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
tests/snapshot_tests/snapshot_apps/footer_classic_styling.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from textual.app import App, ComposeResult | ||
from textual.widgets import Footer | ||
|
||
|
||
class ClassicFooterStylingApp(App): | ||
""" | ||
This app attempts to replicate the styling of the classic footer in | ||
Textual before v0.63.0, in particular the distinct background color | ||
for the binding keys and padding between the key and binding description. | ||
Regression test for https://github.com/Textualize/textual/issues/4557 | ||
""" | ||
|
||
CSS = """ | ||
Footer { | ||
background: $accent; | ||
FooterKey { | ||
background: $accent; | ||
color: $text; | ||
.footer-key--key { | ||
background: $accent-darken-2; | ||
color: $text; | ||
padding-right: 1; | ||
} | ||
} | ||
} | ||
""" | ||
|
||
BINDINGS = [ | ||
("ctrl+t", "app.toggle_dark", "Toggle Dark mode"), | ||
("ctrl+q", "quit", "Quit"), | ||
] | ||
|
||
def compose(self) -> ComposeResult: | ||
yield Footer() | ||
|
||
def on_mount(self) -> None: | ||
footer = self.query_one(Footer) | ||
footer.upper_case_keys = True | ||
footer.ctrl_to_caret = False | ||
|
||
|
||
if __name__ == "__main__": | ||
app = ClassicFooterStylingApp() | ||
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters