ui: Add text_ellipsis
method to Label
s (#22118)
This PR adds a `text_ellipsis` method to `Label`s. This can be used to truncate the text with an ellipsis without needing to wrap the `Label` in another element. Release Notes: - N/A
This commit is contained in:
parent
ac24f074df
commit
8e71e46867
5 changed files with 57 additions and 39 deletions
|
@ -217,11 +217,10 @@ impl PickerDelegate for SlashCommandDelegate {
|
|||
)),
|
||||
)
|
||||
.child(
|
||||
div().overflow_hidden().text_ellipsis().child(
|
||||
Label::new(info.description.clone())
|
||||
.size(LabelSize::Small)
|
||||
.color(Color::Muted),
|
||||
),
|
||||
Label::new(info.description.clone())
|
||||
.size(LabelSize::Small)
|
||||
.color(Color::Muted)
|
||||
.text_ellipsis(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue