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
impl OverlayController
pub fn begin_frame<H: UiHost>(app: &mut H, window: AppWindowId)
pub fn last_known_window_bounds<H: UiHost>( app: &mut H, window: AppWindowId, ) -> Option<Rect>
pub fn popover_root_name(id: GlobalElementId) -> String
pub fn modal_root_name(id: GlobalElementId) -> String
pub fn tooltip_root_name(id: GlobalElementId) -> String
pub fn hover_overlay_root_name(id: GlobalElementId) -> String
pub fn toast_layer_root_name(id: GlobalElementId) -> String
pub fn request<H: UiHost>( cx: &mut ElementContext<'_, H>, request: OverlayRequest, )
pub fn request_for_window<H: UiHost>( app: &mut H, window: AppWindowId, request: OverlayRequest, )
pub fn render<H: UiHost + 'static>( ui: &mut UiTree<H>, app: &mut H, services: &mut dyn UiServices, window: AppWindowId, bounds: Rect, )
Sourcepub fn arbitration_snapshot<H: UiHost>(
ui: &UiTree<H>,
) -> OverlayArbitrationSnapshot
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).
Sourcepub fn stack_snapshot_for_window<H: UiHost>(
ui: &UiTree<H>,
app: &mut H,
window: AppWindowId,
) -> WindowOverlayStackSnapshot
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.
pub fn fade_presence<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, fade_ticks: u64, ) -> PresenceOutput
pub fn fade_presence_with_durations<H: UiHost>( cx: &mut ElementContext<'_, H>, open: bool, open_ticks: u64, close_ticks: u64, ) -> PresenceOutput
Sourcepub fn transition<H: UiHost>(
cx: &mut ElementContext<'_, H>,
open: bool,
ticks: u64,
) -> TransitionOutput
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.
Sourcepub fn transition_with_durations<H: UiHost>(
cx: &mut ElementContext<'_, H>,
open: bool,
open_ticks: u64,
close_ticks: u64,
) -> TransitionOutput
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.
Sourcepub fn transition_with_durations_duration<H: UiHost>(
cx: &mut ElementContext<'_, H>,
open: bool,
open_duration: Duration,
close_duration: Duration,
) -> TransitionOutput
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.
Sourcepub 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
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.
Sourcepub 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
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.