iced_core/
alignment.rs
1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5pub enum Alignment {
6 Start,
8
9 Center,
11
12 End,
14}
15
16impl From<Horizontal> for Alignment {
17 fn from(horizontal: Horizontal) -> Self {
18 match horizontal {
19 Horizontal::Left => Self::Start,
20 Horizontal::Center => Self::Center,
21 Horizontal::Right => Self::End,
22 }
23 }
24}
25
26impl From<Vertical> for Alignment {
27 fn from(vertical: Vertical) -> Self {
28 match vertical {
29 Vertical::Top => Self::Start,
30 Vertical::Center => Self::Center,
31 Vertical::Bottom => Self::End,
32 }
33 }
34}
35
36#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
38pub enum Horizontal {
39 Left,
41
42 Center,
44
45 Right,
47}
48
49impl From<Alignment> for Horizontal {
50 fn from(alignment: Alignment) -> Self {
51 match alignment {
52 Alignment::Start => Self::Left,
53 Alignment::Center => Self::Center,
54 Alignment::End => Self::Right,
55 }
56 }
57}
58
59#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
61pub enum Vertical {
62 Top,
64
65 Center,
67
68 Bottom,
70}
71
72impl From<Alignment> for Vertical {
73 fn from(alignment: Alignment) -> Self {
74 match alignment {
75 Alignment::Start => Self::Top,
76 Alignment::Center => Self::Center,
77 Alignment::End => Self::Bottom,
78 }
79 }
80}