pub struct GridStyle {
pub columns: Vec<Track>,
pub rows: Vec<Track>,
pub column_gap: f32,
pub row_gap: f32,
pub auto_flow: GridFlow,
pub align_items: Align,
pub justify_items: Align,
}Expand description
Layout style for a grid container.
Fields§
§columns: Vec<Track>Column track definitions.
rows: Vec<Track>Row track definitions.
column_gap: f32Gap between columns.
row_gap: f32Gap between rows.
auto_flow: GridFlowAuto-placement direction.
align_items: AlignDefault cross-axis alignment of items within their cells.
justify_items: AlignDefault main-axis alignment of items within their cells.
Implementations§
Source§impl GridStyle
impl GridStyle
Sourcepub fn new(columns: impl IntoIterator<Item = Track>) -> GridStyle
pub fn new(columns: impl IntoIterator<Item = Track>) -> GridStyle
Creates a style with the given column tracks.
Sourcepub fn rows(self, rows: impl IntoIterator<Item = Track>) -> GridStyle
pub fn rows(self, rows: impl IntoIterator<Item = Track>) -> GridStyle
Sets the row tracks.
Sourcepub fn column_gap(self, gap: f32) -> GridStyle
pub fn column_gap(self, gap: f32) -> GridStyle
Sets the gap between columns.
Sourcepub fn column_flow(self) -> GridStyle
pub fn column_flow(self) -> GridStyle
Uses column-wise auto placement.
Sourcepub fn align_items(self, align: Align) -> GridStyle
pub fn align_items(self, align: Align) -> GridStyle
Sets the default cross-axis alignment of items.
Sourcepub fn justify_items(self, align: Align) -> GridStyle
pub fn justify_items(self, align: Align) -> GridStyle
Sets the default main-axis alignment of items.
Sourcepub fn place_items(self, align: Align) -> GridStyle
pub fn place_items(self, align: Align) -> GridStyle
Sets both the align and justify alignment of items.
Trait Implementations§
impl StructuralPartialEq for GridStyle
Auto Trait Implementations§
impl Freeze for GridStyle
impl RefUnwindSafe for GridStyle
impl Send for GridStyle
impl Sync for GridStyle
impl Unpin for GridStyle
impl UnsafeUnpin for GridStyle
impl UnwindSafe for GridStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more