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

Fine tune parameter controls label format #58

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

liancheng
Copy link

@liancheng liancheng commented Sep 5, 2023

Refactored label generation of parameter controls to have consistent white spacing between label segments.

Here is a comparison of before and after this PR:

image

else:
names = Text(" / ", style="dim").join([Text(n) for n in name])
text = Text.from_markup(
f"{names}[dim]{' multiple' if multiple else ''} {type.name}[/] {' [b red]*[/]required' if is_required else ''}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The {name} part here is a bug as Text.plain is used when a Text object is referenced in an f-string, so we lose the dim style in the rendered result.

However, it looks better without the dim, so I did not include the dim in this PR.

@daneah daneah added the enhancement New feature or request label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants