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:
ickshonpe 2025-02-11 18:29:06 +00:00 committed by GitHub
parent fb0e5c484f
commit c896ad6146
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)),
));
});
}
}