Split the labels in many_buttons (#17802)
# Objective Add some multi-span text to the `many_buttons` benchmark by splitting up each button label text into two different coloured text spans. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
This commit is contained in:
parent
fb0e5c484f
commit
c896ad6146
@ -289,14 +289,24 @@ fn spawn_button(
|
||||
|
||||
if spawn_text {
|
||||
builder.with_children(|parent| {
|
||||
parent.spawn((
|
||||
Text(format!("{column}, {row}")),
|
||||
TextFont {
|
||||
font_size: FONT_SIZE,
|
||||
..default()
|
||||
},
|
||||
TextColor(Color::srgb(0.2, 0.2, 0.2)),
|
||||
));
|
||||
// These labels are split to stress test multi-span text
|
||||
parent
|
||||
.spawn((
|
||||
Text(format!("{column}, ")),
|
||||
TextFont {
|
||||
font_size: FONT_SIZE,
|
||||
..default()
|
||||
},
|
||||
TextColor(Color::srgb(0.5, 0.2, 0.2)),
|
||||
))
|
||||
.with_child((
|
||||
TextSpan(format!("{row}")),
|
||||
TextFont {
|
||||
font_size: FONT_SIZE,
|
||||
..default()
|
||||
},
|
||||
TextColor(Color::srgb(0.2, 0.2, 0.5)),
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user