Skip to main content

Positioner

Struct Positioner 

Source
pub struct Positioner {
    pub size: Option<(u32, u32)>,
    pub size_limits: Limits,
    pub anchor_rect: Rectangle<i32>,
    pub anchor: Anchor,
    pub gravity: Gravity,
    pub constraint_adjustment: u32,
    pub offset: (i32, i32),
    pub reactive: bool,
    pub window_geometry: Option<(i32, i32, i32, i32)>,
    pub shadow_padding: u32,
}
Available on Unix and neither Android nor iOS nor macOS only.
Expand description

Positioner configuration for popup placement.

Fields§

§size: Option<(u32, u32)>

Size of the popup (if None, will be auto-sized)

§size_limits: Limits

Size limits for auto-sizing

§anchor_rect: Rectangle<i32>

Rectangle on the parent surface to anchor to

§anchor: Anchor

Where on the anchor_rect to attach

§gravity: Gravity

Direction the popup extends from the anchor point

§constraint_adjustment: u32

How to adjust if popup would be constrained

§offset: (i32, i32)

Offset from the calculated position

§reactive: bool

Whether popup should reposition when parent moves

§window_geometry: Option<(i32, i32, i32, i32)>

Window geometry (x, y, width, height) in logical pixels.

Tells the compositor which part of the surface is visible content (excluding shadows/decorations). The compositor uses this for constraint adjustment (SLIDE/FLIP) — only the geometry rect is kept on-screen, not the full surface.

§shadow_padding: u32

Shadow padding in logical pixels.

When set and size is None (auto-sizing), iced will automatically compute window_geometry from the measured content size minus this padding on each side. This tells the compositor to only constrain the visible content area, not the shadow.

Trait Implementations§

Source§

impl Clone for Positioner

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Positioner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Positioner

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Hash for Positioner

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.