Skip to main content

paint_transient

Function paint_transient 

pub fn paint_transient(
    scene: &mut Scene,
    transform: Affine,
    text_renderer: &mut TextRenderer,
    theme: &Theme,
    area: Rect,
    anchor: ToastAnchor,
    card: &ToastCard<'_>,
) -> ToastCardHit
Expand description

Paint a transient toast in area, at anchor.

This is the immediate-mode counterpart to ToastStack, for apps that already own their notification lifetime (check it with transient_expired). The card is as wide as its title and body need, up to a readable width, and wraps them there; it holds one action (ToastCard::action) beside the text. The returned geometry lets callers hit-test the action and the dismiss control.