1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[typeshare::typeshare]
pub enum LayoutConstraintVertical {
/// Node is laid out relative to top of the containing frame
Top,
/// Node is laid out relative to bottom of the containing frame
Bottom,
/// Node is vertically centered relative to containing frame
Center,
/// Both top and bottom of node are constrained relative to containing frame (node stretches with frame)
TopBottom,
/// Node scales vertically with containing frame
Scale,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[typeshare::typeshare]
pub enum LayoutConstraintHorizontal {
/// Node is laid out relative to left of the containing frame
Left,
/// Node is laid out relative to right of the containing frame
Right,
/// Node is horizontally centered relative to containing frame
Center,
/// Both left and right of node are constrained relative to containing frame (node stretches with frame)
LeftRight,
/// Node scales horizontally with containing frame
Scale,
}
/// Layout constraint relative to containing Frame
#[derive(Debug, Deserialize, Serialize)]
#[typeshare::typeshare]
pub struct LayoutConstraint {
pub vertical: LayoutConstraintVertical,
pub horizontal: LayoutConstraintHorizontal,
}