Skip to content

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

@liancheng liancheng force-pushed the param-control-label branch from d493678 to c0e0f1a Compare August 1, 2024 16:19
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