Skip to main content

OverlayController

Struct OverlayController 

Source
pub struct OverlayController;
Expand description

A small, stable facade over window_overlays to keep overlay policy wiring out of shadcn code.

Implementations§

Source§

impl OverlayController

Source

pub fn begin_frame<H: UiHost>(app: &mut H, window: AppWindowId)

Source

pub fn last_known_window_bounds<H: UiHost>( app: &mut H, window: AppWindowId, ) -> Option<Rect>

Source

pub fn popover_root_name(id: GlobalElementId) -> String

Source

pub fn modal_root_name(id: GlobalElementId) -> String

Source

pub fn tooltip_root_name(id: GlobalElementId) -> String

Source

pub fn hover_overlay_root_name(id: GlobalElementId) -> String

Source

pub fn toast_layer_root_name(id: GlobalElementId) -> String

Source

pub fn request<H: UiHost>( cx: &mut ElementContext<'_, H>, request: OverlayRequest, )

Source

pub fn request_for_window<H: UiHost>( app: &mut H, window: AppWindowId, request: OverlayRequest, )

Source

pub fn render<H: UiHost + 'static>( ui: &mut UiTree<H>, app: &mut H, services: &mut dyn UiServices, window: AppWindowId, bounds: Rect, )

Source

pub fn arbitration_snapshot<H: UiHost>( ui: &UiTree<H>, ) -> OverlayArbitrationSnapshot

Computes a stable snapshot of overlay-related input arbitration state from the runtime layer stack.

Recommended usage:

  • call after OverlayController::render(...) (so the layer stack reflects current overlay state),
  • use the snapshot to drive cross-system policies (e.g. docking/viewport suppression, diagnostics).
Source

pub fn stack_snapshot_for_window<H: UiHost>( ui: &UiTree<H>, app: &mut H, window: AppWindowId, ) -> WindowOverlayStackSnapshot

Computes an ordered, window-scoped overlay stack snapshot by combining:

  • runtime layer order (UiTree::debug_layers_in_paint_order),
  • overlay manager state (window_overlays) to map layer IDs to overlay IDs/kinds.

The intent is to give ecosystem integration points a stable “what overlays are currently active, and in what order” view without requiring them to depend on window_overlays internals.

Source

pub fn fade_presence<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, fade_ticks: u64, ) -> PresenceOutput

Source

pub fn fade_presence_with_durations<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, open_ticks: u64, close_ticks: u64, ) -> PresenceOutput

Source

pub fn transition<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, ticks: u64, ) -> TransitionOutput

Drive a general transition timeline using the UI runtime’s monotonic frame clock.

This is the generalized form of fade_presence* and is useful for driving multiple properties (opacity/scale/translation) with a shared open/close timeline.

Source

pub fn transition_with_durations<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, open_ticks: u64, close_ticks: u64, ) -> TransitionOutput

Drive a general transition timeline with separate open/close durations.

Source

pub fn transition_with_durations_duration<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, open_duration: Duration, close_duration: Duration, ) -> TransitionOutput

Drive a general transition timeline with separate open/close wall-clock durations.

Source

pub fn transition_with_durations_and_easing<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, open_ticks: u64, close_ticks: u64, ease: fn(f32) -> f32, ) -> TransitionOutput

Drive a transition timeline with an explicit easing function.

This enables CSS-style easing (e.g. cubic-bezier) while staying deterministic and renderer-agnostic.

Source

pub fn transition_with_durations_and_easing_duration<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, open_duration: Duration, close_duration: Duration, ease: fn(f32) -> f32, ) -> TransitionOutput

Drive a transition timeline with an explicit easing function using wall-clock durations.

Source

pub fn transition_with_durations_and_cubic_bezier<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, open_ticks: u64, close_ticks: u64, bezier: CubicBezier, ) -> TransitionOutput

Source

pub fn transition_with_durations_and_cubic_bezier_duration<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, open_duration: Duration, close_duration: Duration, bezier: CubicBezier, ) -> TransitionOutput

Source

pub fn toast_store<H: UiHost>(app: &mut H) -> Model<ToastStore>

Source

pub fn toast_action( host: &mut dyn UiActionHost, store: Model<ToastStore>, window: AppWindowId, request: ToastRequest, ) -> ToastId

Source

pub fn dismiss_toast_action( host: &mut dyn UiActionHost, store: Model<ToastStore>, window: AppWindowId, id: ToastId, ) -> bool

Source

pub fn dismiss_all_toasts_action( host: &mut dyn UiActionHost, store: Model<ToastStore>, window: AppWindowId, ) -> usize

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