Skip to main content

OverlayRequest

Struct OverlayRequest 

Source
pub struct OverlayRequest {
    pub content_id: WidgetId,
    pub anchor: WidgetId,
    pub placement: OverlayPlacement,
    pub dismiss: DismissBehavior,
    pub layer: OverlayLayer,
    pub parent_overlay: Option<OverlayId>,
    pub on_dismiss: Option<OverlayDismissCallback>,
    pub fade_duration: Option<Duration>,
}
Expand description

A request to show an overlay.

Fields§

§content_id: WidgetId

The root widget of the overlay content.

§anchor: WidgetId

The widget this overlay is anchored to.

§placement: OverlayPlacement

Positioning relative to the anchor.

§dismiss: DismissBehavior

How the overlay is dismissed.

§layer: OverlayLayer

Rendering layer.

§parent_overlay: Option<OverlayId>

Parent overlay (for submenu cascading).

§on_dismiss: Option<OverlayDismissCallback>

Invoked when the overlay is dismissed by any path. Use this to reset anchor-side state (e.g. ComboBox.interaction) when the framework tears down the overlay without going through the anchor’s own key/tap handlers.

§fade_duration: Option<Duration>

Optional fade-in / fade-out duration. When Some, the framework attaches an animated opacity scope to content_id at show time (using the existing set_opacity rendering pipeline — no Fade widget required from the caller), tweens the opacity from 0 → 1 over duration, and on dismiss reverses the tween and defers the actual stack removal by duration. Construct with OverlayRequest::with_fade when the struct-literal idiom isn’t ergonomic.

Implementations§

Source§

impl OverlayRequest

Source

pub fn with_fade(self, duration: Duration) -> Self

Attach a fade-in / fade-out animation to this request. duration controls both directions. The framework wires everything internally — caller does not create a Fade widget or manage a signal:

let req = OverlayRequest { content_id, anchor, ... }
    .with_fade(theme.motion.duration_fast);

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> 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, 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, <T as TryFrom<U>>::Error>

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.