Textualize / textual

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
https://textual.textualize.io/
MIT License
25.2k stars 773 forks source link

fix(footer): add space between binding key and description #4601

Closed TomJGooding closed 4 months ago

TomJGooding commented 4 months ago

Fixes #4557.

I figured this was a simple enough change to just make a PR and see this change was acceptable.

Here's some quick before and after screenshots. I purposely chose the ugliest example with the default footer styling, but for the most part an extra space isn't really too noticeable.

image

image

Please review the following checklist.

willmcgugan commented 4 months ago

I couldn't accept a solution that always added that extra space. One of the main motivations around the Footer redesign was to be more compact.

How about the key component class takes the padding from the Style? That would make it customizable.

TomJGooding commented 3 months ago

@willmcgugan No problem, to be honest I expected you would say that!

How about the key component class takes the padding from the Style? That would make it customizable.

Sorry perhaps I'm missing something obvious, but I don't understand how this might be implemented?

willmcgugan commented 3 months ago

The component style could have padding, which you could look up like this:

self.get_component_style("footer-key--key").padding

The user could then add the space with something like this:

Footer>footer-key--key {
    padding-right: 1;
}