@@ 229,8 229,14 @@ fn set_selected_variant_text(
}
fn setup(mut commands: Commands) {
- let buttons = commands
- .spawn((
+ commands.spawn((
+ Node {
+ width: Val::Percent(100.0),
+ height: Val::Percent(100.0),
+ padding: UiRect::all(Val::Px(8.0)),
+ ..Default::default()
+ },
+ children![(
Node {
width: Val::Percent(100.0),
flex_direction: FlexDirection::Row,
@@ 243,14 249,16 @@ fn setup(mut commands: Commands) {
button(ButtonFunction::Throw, "Throw", THROW_COLOR),
button(ButtonFunction::Despawn, "Despawn Dice", DESPAWN_COLOR),
],
- ))
- .id();
+ )],
+ ));
let dropdown = commands
.spawn((
Node {
width: Val::Percent(100.0),
+ height: Val::Percent(100.0),
flex_direction: FlexDirection::Column,
+ padding: UiRect::all(Val::Px(8.0)),
overflow: Overflow::scroll_y(),
..Default::default()
},
@@ 297,17 305,4 @@ fn setup(mut commands: Commands) {
format!("{:?}", variant),
));
}
-
- let layout = commands
- .spawn((Node {
- width: Val::Percent(100.0),
- height: Val::Percent(100.0),
- flex_direction: FlexDirection::Column,
- align_items: AlignItems::FlexEnd,
- justify_content: JustifyContent::SpaceBetween,
- padding: UiRect::all(Val::Px(8.0)),
- ..Default::default()
- },))
- .id();
- commands.entity(layout).add_children(&[dropdown, buttons]);
}