Skip to main content

OverlayRequest

Struct OverlayRequest 

Source
pub struct OverlayRequest {
Show 18 fields pub kind: OverlayKind, pub id: GlobalElementId, pub root_name: Option<String>, pub trigger: Option<GlobalElementId>, pub dismissable_branches: Vec<GlobalElementId>, pub consume_outside_pointer_events: bool, pub disable_outside_pointer_events: bool, pub close_on_window_focus_lost: bool, pub close_on_window_resize: bool, pub open: Option<Model<bool>>, pub on_open_auto_focus: Option<OnOpenAutoFocus>, pub on_close_auto_focus: Option<OnCloseAutoFocus>, pub dismissible_on_dismiss_request: Option<OnDismissRequest>, pub dismissible_on_pointer_move: Option<OnDismissiblePointerMove>, pub presence: OverlayPresence, pub initial_focus: Option<GlobalElementId>, pub children: Vec<AnyElement>, pub toast_layer: Option<ToastLayerSpec>,
}

Fields§

§kind: OverlayKind§id: GlobalElementId§root_name: Option<String>§trigger: Option<GlobalElementId>§dismissable_branches: Vec<GlobalElementId>

Extra subtrees that should be treated as “inside” for DismissableLayer-style dismissal.

This is used to align Radix DismissableLayerBranch outcomes across disjoint subtrees.

§consume_outside_pointer_events: bool

When an outside-press observer is dispatched for this overlay, suppress normal hit-tested pointer-down dispatch to underlay widgets for the same event.

§disable_outside_pointer_events: bool

When true, pointer events outside the overlay subtree should not reach underlay widgets while the overlay is open (Radix disableOutsidePointerEvents outcome).

§close_on_window_focus_lost: bool

Whether this overlay should close when the OS window loses focus.

§close_on_window_resize: bool

Whether this overlay should close when the OS window is resized (or scale factor changes).

§open: Option<Model<bool>>§on_open_auto_focus: Option<OnOpenAutoFocus>§on_close_auto_focus: Option<OnCloseAutoFocus>§dismissible_on_dismiss_request: Option<OnDismissRequest>§dismissible_on_pointer_move: Option<OnDismissiblePointerMove>§presence: OverlayPresence§initial_focus: Option<GlobalElementId>§children: Vec<AnyElement>§toast_layer: Option<ToastLayerSpec>

Implementations§

Source§

impl OverlayRequest

Source

pub fn dismissible_popover( id: GlobalElementId, trigger: GlobalElementId, open: Model<bool>, presence: OverlayPresence, children: Vec<AnyElement>, ) -> Self

Source

pub fn dismissible_menu( id: GlobalElementId, trigger: GlobalElementId, open: Model<bool>, presence: OverlayPresence, children: Vec<AnyElement>, ) -> Self

Dismissible overlay with non-click-through outside press behavior.

This matches Radix-aligned “menu-like” overlays where an outside click closes the overlay without activating the underlay (ADR 0069).

Source

pub fn modal( id: GlobalElementId, trigger: Option<GlobalElementId>, open: Model<bool>, presence: OverlayPresence, children: Vec<AnyElement>, ) -> Self

Source

pub fn tooltip( id: GlobalElementId, open: Model<bool>, presence: OverlayPresence, children: Vec<AnyElement>, ) -> Self

Source

pub fn hover( id: GlobalElementId, trigger: GlobalElementId, open: Model<bool>, presence: OverlayPresence, children: impl IntoIterator<Item = AnyElement>, ) -> Self

Source

pub fn toast_layer(id: GlobalElementId, store: Model<ToastStore>) -> Self

Source

pub fn close_on_window_focus_lost(self, close: bool) -> Self

Source

pub fn close_on_window_resize(self, close: bool) -> Self

Source

pub fn toast_position(self, position: ToastPosition) -> Self

Source

pub fn toast_toaster_id(self, id: impl Into<Arc<str>>) -> Self

Source

pub fn toast_visible_toasts(self, visible_toasts: usize) -> Self

Source

pub fn toast_expand_by_default(self, expand: bool) -> Self

Source

pub fn toast_rich_colors(self, rich_colors: bool) -> Self

Source

pub fn toast_invert(self, invert: bool) -> Self

Source

pub fn toast_container_aria_label(self, label: impl Into<Arc<str>>) -> Self

Source

pub fn toast_container_aria_label_opt(self, label: Option<Arc<str>>) -> Self

Source

pub fn toast_custom_aria_label_opt(self, label: Option<Arc<str>>) -> Self

Source

pub fn toast_offset(self, offset: ToastOffset) -> Self

Source

pub fn toast_offset_opt(self, offset: Option<ToastOffset>) -> Self

Source

pub fn toast_mobile_offset(self, offset: ToastOffset) -> Self

Source

pub fn toast_mobile_offset_opt(self, offset: Option<ToastOffset>) -> Self

Source

pub fn toast_style(self, style: ToastLayerStyle) -> Self

Source

pub fn toast_margin(self, margin: Px) -> Self

Source

pub fn toast_gap(self, gap: Px) -> Self

Source

pub fn toast_min_width(self, width: Px) -> Self

Source

pub fn toast_max_width(self, width: Px) -> Self

Source

pub fn dismissable_branches( self, branches: impl IntoIterator<Item = GlobalElementId>, ) -> Self

Source

pub fn add_dismissable_branch(self, branch: GlobalElementId) -> Self

Source

pub fn extend_dismissable_branches( self, branches: impl IntoIterator<Item = GlobalElementId>, ) -> Self

Source

pub fn consume_outside_pointer_events(self, consume: bool) -> Self

Source

pub fn disable_outside_pointer_events(self, disable: bool) -> Self

Trait Implementations§

Source§

impl Debug for OverlayRequest

Source§

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

Formats the value using the given formatter. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = Infallible

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.
Source§

impl<T> UiElementA11yExt for T

Source§

fn a11y(self, decoration: SemanticsDecoration) -> UiElementWithA11y<Self>

Source§

fn a11y_role(self, role: SemanticsRole) -> UiElementWithA11y<Self>

Source§

fn a11y_label(self, label: impl Into<Arc<str>>) -> UiElementWithA11y<Self>

Source§

fn a11y_value(self, value: impl Into<Arc<str>>) -> UiElementWithA11y<Self>

Source§

fn a11y_disabled(self, disabled: bool) -> UiElementWithA11y<Self>

Source§

fn a11y_selected(self, selected: bool) -> UiElementWithA11y<Self>

Source§

fn a11y_expanded(self, expanded: bool) -> UiElementWithA11y<Self>

Source§

fn a11y_checked(self, checked: Option<bool>) -> UiElementWithA11y<Self>

Source§

impl<T> UiElementKeyContextExt for T

Source§

fn key_context( self, key_context: impl Into<Arc<str>>, ) -> UiElementWithKeyContext<Self>

Source§

impl<T> UiElementTestIdExt for T

Source§

fn test_id(self, id: impl Into<Arc<str>>) -> UiElementWithTestId<Self>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more