fix: Use flexbox helpers
This commit is contained in:
@@ -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)),
|
||||
|
||||
@@ -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![
|
||||
(
|
||||
|
||||
@@ -2,3 +2,4 @@ pub mod button;
|
||||
pub mod flexbox;
|
||||
|
||||
pub use button::{button, pill_button};
|
||||
pub use flexbox::Flexbox;
|
||||
|
||||
Reference in New Issue
Block a user