Skip to main content

euv_core/style/layout_prop/
struct.rs

1use super::*;
2
3/// Layout-affecting properties separated from paint properties for surgical dirty-flag tracking.
4#[derive(Clone, Copy, Data, Debug, PartialEq)]
5pub struct LayoutStyle {
6    /// Display mode (`Flex`, `Block`, `Grid`, `None`).
7    #[get(type(copy))]
8    pub(crate) display: Display,
9    /// Positioning strategy (`Relative`, `Absolute`, `Fixed`).
10    #[get(type(copy))]
11    pub(crate) position: Position,
12    /// Flex main-axis direction.
13    #[get(type(copy))]
14    pub(crate) flex_direction: FlexDirection,
15    /// Flex line wrapping mode.
16    #[get(type(copy))]
17    pub(crate) flex_wrap: FlexWrap,
18    /// Main-axis justification.
19    #[get(type(copy))]
20    pub(crate) justify_content: JustifyContent,
21    /// Cross-axis alignment for children.
22    #[get(type(copy))]
23    pub(crate) align_items: AlignItems,
24    /// Cross-axis alignment override for this node.
25    #[get(type(copy))]
26    pub(crate) align_self: AlignSelf,
27    /// Overflow clipping/scrolling behavior.
28    #[get(type(copy))]
29    pub(crate) overflow: Overflow,
30    /// Flex grow factor (`>= 0.0`).
31    #[get(type(copy))]
32    pub(crate) flex_grow: f32,
33    /// Flex shrink factor (`>= 0.0`).
34    #[get(type(copy))]
35    pub(crate) flex_shrink: f32,
36    /// Flex basis length.
37    #[get(type(copy))]
38    pub(crate) flex_basis: Length,
39    /// Explicit grid column count when `display == Display::Grid`.
40    #[get(type(copy))]
41    pub(crate) grid_columns: u16,
42    /// Width specification.
43    #[get(type(copy))]
44    pub(crate) width: Length,
45    /// Height specification.
46    #[get(type(copy))]
47    pub(crate) height: Length,
48    /// Minimum width constraint.
49    #[get(type(copy))]
50    pub(crate) min_width: Length,
51    /// Minimum height constraint.
52    #[get(type(copy))]
53    pub(crate) min_height: Length,
54    /// Maximum width constraint.
55    #[get(type(copy))]
56    pub(crate) max_width: Length,
57    /// Maximum height constraint.
58    #[get(type(copy))]
59    pub(crate) max_height: Length,
60    /// Outer margin insets.
61    #[get(type(copy))]
62    pub(crate) margin: Edges,
63    /// Inner padding insets.
64    #[get(type(copy))]
65    pub(crate) padding: Edges,
66    /// Row gap between children in logical pixels.
67    #[get(type(copy))]
68    pub(crate) row_gap: f32,
69    /// Column gap between children in logical pixels.
70    #[get(type(copy))]
71    pub(crate) column_gap: f32,
72    /// Optional explicit top offset for positioned elements.
73    #[get(skip)]
74    pub(crate) top: Option<f32>,
75    /// Optional explicit right offset for positioned elements.
76    #[get(skip)]
77    pub(crate) right: Option<f32>,
78    /// Optional explicit bottom offset for positioned elements.
79    #[get(skip)]
80    pub(crate) bottom: Option<f32>,
81    /// Optional explicit left offset for positioned elements.
82    #[get(skip)]
83    pub(crate) left: Option<f32>,
84    /// Stacking order for painting and hit-testing.
85    #[get(type(copy))]
86    pub(crate) z_index: i32,
87    /// Optional fixed aspect ratio (`width / height`).
88    #[get(skip)]
89    pub(crate) aspect_ratio: Option<f32>,
90}