feat: Add helper to flexbox
This commit is contained in:
@@ -4,6 +4,7 @@ pub trait Flexbox {
|
|||||||
fn hstack(spacing: Val) -> Self;
|
fn hstack(spacing: Val) -> Self;
|
||||||
fn vstack(spacing: Val) -> Self;
|
fn vstack(spacing: Val) -> Self;
|
||||||
fn center() -> Self;
|
fn center() -> Self;
|
||||||
|
fn from_padding(padding: UiRect) -> Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Flexbox for Node {
|
impl Flexbox for Node {
|
||||||
@@ -30,4 +31,11 @@ impl Flexbox for Node {
|
|||||||
..default()
|
..default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn from_padding(padding: UiRect) -> Self {
|
||||||
|
Node {
|
||||||
|
padding,
|
||||||
|
..default()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user