ferroui_base/input/navigation/xy_focus_navigation_strategy.rs
1/// Specifies the disambiguation strategy used for navigating between
2/// multiple candidate targets with directional (XY) navigation.
3#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
4#[repr(i32)]
5pub enum XYFocusNavigationStrategy {
6 /// Indicates that navigation strategy is inherited from the element's
7 /// ancestors. If all ancestors have a value of `Auto`, the fallback
8 /// strategy is `Projection`.
9 #[default]
10 Auto = 0,
11 /// Indicates that focus moves to the first element encountered when
12 /// projecting the edge of the currently focused element in the direction
13 /// of navigation.
14 Projection = 1,
15 /// Indicates that focus moves to the element closest to the axis of the
16 /// navigation direction.
17 NavigationDirectionDistance = 2,
18 /// Indicates that focus moves to the closest element based on the
19 /// shortest 2D distance (Manhattan metric).
20 RectilinearDistance = 3,
21}