diff --git a/src/features/savegame/ui/load.rs b/src/features/savegame/ui/load.rs index 4478064..7517907 100644 --- a/src/features/savegame/ui/load.rs +++ b/src/features/savegame/ui/load.rs @@ -9,9 +9,7 @@ pub fn spawn_load_popup(commands: &mut Commands) { position_type: PositionType::Absolute, width: percent(100), height: percent(100), - justify_content: JustifyContent::Center, - align_items: AlignItems::Center, - ..default() + ..Node::center() }, ZIndex(1), BackgroundColor(Color::srgba(0.0, 0.0, 0.0, 0.8)), @@ -22,13 +20,11 @@ pub fn spawn_load_popup(commands: &mut Commands) { Node { width: px(600.0), height: px(500.0), - flex_direction: FlexDirection::Column, - align_items: AlignItems::Center, padding: UiRect::all(px(20.0)), - ..default() + ..Node::vstack(px(10)) }, BackgroundColor(Color::srgb(0.2, 0.2, 0.2)), - BorderRadius::all(Val::Px(10.0)), + BorderRadius::all(px(10.0)), )) .with_children(|parent| { parent.spawn(( @@ -79,12 +75,10 @@ pub fn spawn_load_popup(commands: &mut Commands) { Node { width: percent(100), height: px(80), - justify_content: JustifyContent::Center, - align_items: AlignItems::Center, flex_direction: FlexDirection::Row, column_gap: px(10.0), padding: UiRect::horizontal(px(10.0)), - ..default() + ..Node::center() }, BackgroundColor(ButtonVariant::Secondary.normal_background()), BorderRadius::all(px(10)), diff --git a/src/features/start_screen/mod.rs b/src/features/start_screen/mod.rs index 4ad0a06..78d2de6 100644 --- a/src/features/start_screen/mod.rs +++ b/src/features/start_screen/mod.rs @@ -20,11 +20,9 @@ fn setup(mut commands: Commands) { Node { width: percent(100), height: percent(100), - justify_content: JustifyContent::Center, - align_items: AlignItems::Center, flex_direction: FlexDirection::Column, row_gap: px(10), - ..default() + ..Node::center() }, children![ ( diff --git a/src/features/ui/ui/mod.rs b/src/features/ui/ui/mod.rs index f8515af..637968e 100644 --- a/src/features/ui/ui/mod.rs +++ b/src/features/ui/ui/mod.rs @@ -2,3 +2,4 @@ pub mod button; pub mod flexbox; pub use button::{button, pill_button}; +pub use flexbox::Flexbox;