Skip to main content

euv_ui/component/grid/view/
struct.rs

1use super::*;
2
3/// One column of a grid row.
4///
5/// Carries the column's share of the row and the space it is pushed to the
6/// right by, both counted in the row's twenty-four columns.
7#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
8pub struct EuvGridCol {
9    /// How many of the row's twenty-four columns this column takes.
10    #[get(type(copy))]
11    pub span: u32,
12    /// How many columns to push this one to the right by.
13    #[get(type(copy))]
14    pub offset: u32,
15}
16
17/// Props for the [`euv_grid`] component.
18///
19/// Defines the strongly-typed interface for a grid row: how its columns are
20/// laid out and whether the row spaces them with a gap.
21#[derive(Clone, CustomDebug, Default)]
22pub struct EuvGridProps {
23    /// The columns, in order.
24    ///
25    /// The Nth entry lays out the Nth child of the grid; a child with no
26    /// entry here falls back to the default column.
27    pub cols: Vec<EuvGridCol>,
28    /// Whether the row spaces its columns with a gap.
29    pub gutter: bool,
30}