ferroui_controls/placement_mode.rs
1/// Defines the placement for a popup control.
2#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
3#[repr(i32)]
4pub enum PlacementMode {
5 /// The popup is placed at the pointer position.
6 #[default]
7 Pointer = 0,
8
9 /// Preferred location is below the target element.
10 Bottom = 1,
11
12 /// Preferred location is to the right of the target element.
13 Right = 2,
14
15 /// Preferred location is to the left of the target element.
16 Left = 3,
17
18 /// Preferred location is above the target element.
19 Top = 4,
20
21 /// Preferred location is centered over the target element.
22 Center = 5,
23
24 /// The popup is placed according to the popup's placement anchor and
25 /// placement gravity rules.
26 AnchorAndGravity = 6,
27
28 /// Preferred location is above the target element, with the left edge
29 /// of the popup aligned with the left edge of the target element.
30 TopEdgeAlignedLeft = 7,
31
32 /// Preferred location is above the target element, with the right edge
33 /// of popup aligned with right edge of the target element.
34 TopEdgeAlignedRight = 8,
35
36 /// Preferred location is below the target element, with the left edge
37 /// of popup aligned with left edge of the target element.
38 BottomEdgeAlignedLeft = 9,
39
40 /// Preferred location is below the target element, with the right edge
41 /// of popup aligned with right edge of the target element.
42 BottomEdgeAlignedRight = 10,
43
44 /// Preferred location is to the left of the target element, with the
45 /// top edge of popup aligned with top edge of the target element.
46 LeftEdgeAlignedTop = 11,
47
48 /// Preferred location is to the left of the target element, with the
49 /// bottom edge of popup aligned with bottom edge of the target element.
50 LeftEdgeAlignedBottom = 12,
51
52 /// Preferred location is to the right of the target element, with the
53 /// top edge of popup aligned with top edge of the target element.
54 RightEdgeAlignedTop = 13,
55
56 /// Preferred location is to the right of the target element, with the
57 /// bottom edge of popup aligned with bottom edge of the target element.
58 RightEdgeAlignedBottom = 14,
59
60 /// A position and repositioning behavior that is defined by the popup's
61 /// custom popup placement callback.
62 Custom = 15,
63}