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 {
|
if spawn_text {
|
||||||
builder.with_children(|parent| {
|
builder.with_children(|parent| {
|
||||||
parent.spawn((
|
// These labels are split to stress test multi-span text
|
||||||
Text(format!("{column}, {row}")),
|
parent
|
||||||
TextFont {
|
.spawn((
|
||||||
font_size: FONT_SIZE,
|
Text(format!("{column}, ")),
|
||||||
..default()
|
TextFont {
|
||||||
},
|
font_size: FONT_SIZE,
|
||||||
TextColor(Color::srgb(0.2, 0.2, 0.2)),
|
..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