FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    PopupPositionerConstraintAdjustment

    struct · ferroui-controls · v0.5.0

    struct PopupPositionerConstraintAdjustment
    

    Defines how a popup position will be adjusted if the unadjusted position would result in the popup being partly constrained.

    Whether a popup is considered 'constrained' is left to the positioner to determine. For example, the popup may be partly outside the target platform defined 'work area', thus necessitating the popup's position be adjusted until it is entirely inside the work area.

    View source

    Members

    NONE

    const NONE: Self
    

    Don't alter the surface position even if it is constrained on some axis, for example partially outside the edge of an output.

    Source

    SLIDE_X

    const SLIDE_X: Self
    

    Slide the surface along the x axis until it is no longer constrained.

    First try to slide towards the direction of the gravity on the x axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.

    Then try to slide towards the opposite direction of the gravity on the x axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.

    Source

    SLIDE_Y

    const SLIDE_Y: Self
    

    Slide the surface along the y axis until it is no longer constrained.

    First try to slide towards the direction of the gravity on the y axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.

    Then try to slide towards the opposite direction of the gravity on the y axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.

    Source

    FLIP_X

    const FLIP_X: Self
    

    Invert the anchor and gravity on the x axis if the surface is constrained on the x axis.

    For example, if the left edge of the surface is constrained, the gravity is 'left' and the anchor is 'left', change the gravity to 'right' and the anchor to 'right'.

    If the adjusted position also ends up being constrained, the resulting position of the FlipX adjustment will be the one before the adjustment.

    Source

    FLIP_Y

    const FLIP_Y: Self
    

    Invert the anchor and gravity on the y axis if the surface is constrained on the y axis.

    For example, if the bottom edge of the surface is constrained, the gravity is 'bottom' and the anchor is 'bottom', change the gravity to 'top' and the anchor to 'top'.

    The adjusted position is calculated given the original anchor rectangle and offset, but with the new flipped anchor and gravity values.

    If the adjusted position also ends up being constrained, the resulting position of the FlipY adjustment will be the one before the adjustment.

    Source

    RESIZE_X

    const RESIZE_X: Self
    

    Horizontally resize the surface.

    Resize the surface horizontally so that it is completely unconstrained.

    Source

    RESIZE_Y

    const RESIZE_Y: Self
    

    Vertically resize the surface.

    Resize the surface vertically so that it is completely unconstrained.

    Source

    ALL

    const ALL: Self
    

    All the adjustments.

    Source

    empty

    const fn empty() -> Self
    

    Get a flags value with all bits unset.

    Source

    all

    const fn all() -> Self
    

    Get a flags value with all known bits set.

    Source

    bits

    const fn bits(self: &Self) -> i32
    

    Get the underlying bits value.

    The returned value is exactly the bits set in this flags value.

    Source

    from_bits

    const fn from_bits(bits: i32) -> $crate::__private::core::option::Option<Self>
    

    Convert from a bits value.

    This method will return None if any unknown bits are set.

    Source

    from_bits_truncate

    const fn from_bits_truncate(bits: i32) -> Self
    

    Convert from a bits value, unsetting any unknown bits.

    Source

    from_bits_retain

    const fn from_bits_retain(bits: i32) -> Self
    

    Convert from a bits value exactly.

    Source

    from_name

    fn from_name(name: &str) -> $crate::__private::core::option::Option<Self>
    

    Get a flags value with the bits of a flag with the given name set.

    This method will return None if name is empty or doesn't correspond to any named flag.

    Source

    is_empty

    const fn is_empty(self: &Self) -> bool
    

    Whether all bits in self are unset.

    Source

    is_all

    const fn is_all(self: &Self) -> bool
    

    Whether all known bits in this flags value are set.

    Source

    intersects

    const fn intersects(self: &Self, other: Self) -> bool
    

    Whether any set bits in other are also set in self.

    Source

    contains

    const fn contains(self: &Self, other: Self) -> bool
    

    Whether all set bits in other are also set in self.

    Source

    insert

    fn insert(self: &mut Self, other: Self)
    

    The bitwise or (|) of the bits in self and other.

    Source

    remove

    fn remove(self: &mut Self, other: Self)
    

    The intersection of self with the complement of other (&!).

    This method is not equivalent to self & !other when other has unknown bits set. remove won't truncate other, but the ! operator will.

    Source

    toggle

    fn toggle(self: &mut Self, other: Self)
    

    The bitwise exclusive-or (^) of the bits in self and other.

    Source

    set

    fn set(self: &mut Self, other: Self, value: bool)
    

    Call insert when value is true or remove when value is false.

    Source

    intersection

    const fn intersection(self: Self, other: Self) -> Self
    

    The bitwise and (&) of the bits in self and other.

    Source

    union

    const fn union(self: Self, other: Self) -> Self
    

    The bitwise or (|) of the bits in self and other.

    Source

    difference

    const fn difference(self: Self, other: Self) -> Self
    

    The intersection of self with the complement of other (&!).

    This method is not equivalent to self & !other when other has unknown bits set. difference won't truncate other, but the ! operator will.

    Source

    symmetric_difference

    const fn symmetric_difference(self: Self, other: Self) -> Self
    

    The bitwise exclusive-or (^) of the bits in self and other.

    Source

    complement

    const fn complement(self: Self) -> Self
    

    The bitwise negation (!) of the bits in self, truncating the result.

    Source

    iter

    const fn iter(self: &Self) -> $crate::iter::Iter<PopupPositionerConstraintAdjustment>
    

    Yield a set of contained flags values.

    Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.

    Source

    iter_names

    const fn iter_names(self: &Self) -> $crate::iter::IterNames<PopupPositionerConstraintAdjustment>
    

    Yield a set of contained named flags values.

    This method is like iter, except only yields bits in contained named flags. Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Debug
    • Default
    • StructuralPartialEq
    • PartialEq
    • Eq
    • Hash
    • Flags
    • PublicFlags
    • Binary
    • Octal
    • LowerHex
    • UpperHex
    • BitOr
    • BitOrAssign
    • BitXor
    • BitXorAssign
    • BitAnd
    • BitAndAssign
    • Sub
    • SubAssign
    • Not
    • Extend<PopupPositionerConstraintAdjustment>
    • FromIterator<PopupPositionerConstraintAdjustment>
    • IntoIterator
    • MarkupTyped
    • ValueTypeRegistration

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.