Struct floating_ui_core::middleware::FlipOptions
source · pub struct FlipOptions<Element: Clone> {
pub detect_overflow: Option<DetectOverflowOptions<Element>>,
pub main_axis: Option<bool>,
pub cross_axis: Option<bool>,
pub fallback_placements: Option<Vec<Placement>>,
pub fallback_strategy: Option<FallbackStrategy>,
pub fallback_axis_side_direction: Option<Alignment>,
pub flip_alignment: Option<bool>,
}Expand description
Options for Flip middleware.
Fields§
§detect_overflow: Option<DetectOverflowOptions<Element>>Options for detect_overflow.
Defaults to DetectOverflowOptions::default.
main_axis: Option<bool>The axis that runs along the side of the floating element. Determines whether overflow along this axis is checked to perform a flip.
Defaults to true.
cross_axis: Option<bool>The axis that runs along the alignment of the floating element. Determines whether overflow along this axis is checked to perform a flip.
Defaults to true.
fallback_placements: Option<Vec<Placement>>Placements to try sequentially if the preferred placement does not fit.
Defaults to the opposite placement.
fallback_strategy: Option<FallbackStrategy>What strategy to use when no placements fit.
Defaults to FallbackStrategy::BestFit.
fallback_axis_side_direction: Option<Alignment>Whether to allow fallback to the perpendicular axis of the preferred placement, and if so, which side direction along the axis to prefer.
Defaults to Option::None (disallow fallback).
flip_alignment: Option<bool>Whether to flip to placements with the opposite alignment if they fit better.
Defaults to true.
Implementations§
source§impl<Element: Clone> FlipOptions<Element>
impl<Element: Clone> FlipOptions<Element>
sourcepub fn detect_overflow(self, value: DetectOverflowOptions<Element>) -> Self
pub fn detect_overflow(self, value: DetectOverflowOptions<Element>) -> Self
Set detect_overflow option.
sourcepub fn cross_axis(self, value: bool) -> Self
pub fn cross_axis(self, value: bool) -> Self
Set cross_axis option.
sourcepub fn fallback_placements(self, value: Vec<Placement>) -> Self
pub fn fallback_placements(self, value: Vec<Placement>) -> Self
Set fallback_placements option.
sourcepub fn fallback_strategy(self, value: FallbackStrategy) -> Self
pub fn fallback_strategy(self, value: FallbackStrategy) -> Self
Set fallback_strategy option.
sourcepub fn fallback_axis_side_direction(self, value: Alignment) -> Self
pub fn fallback_axis_side_direction(self, value: Alignment) -> Self
Set fallback_axis_side_direction option.
sourcepub fn flip_alignment(self, value: bool) -> Self
pub fn flip_alignment(self, value: bool) -> Self
Set flip_alignment option.
Trait Implementations§
source§impl<Element: Clone + Clone> Clone for FlipOptions<Element>
impl<Element: Clone + Clone> Clone for FlipOptions<Element>
source§fn clone(&self) -> FlipOptions<Element>
fn clone(&self) -> FlipOptions<Element>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more