pub struct Toasts { /* private fields */ }Expand description
Renderer for the enqueued toast stack.
Configure placement via the builder, then call Toasts::render once
per frame. Multiple Toasts::render calls per frame are a mistake —
each one will paint the whole stack.
Implementations§
Source§impl Toasts
impl Toasts
Sourcepub fn new() -> Self
pub fn new() -> Self
Start a new configuration. Defaults: anchored to the bottom-right with a 12-pt offset, up to 5 toasts visible, 320-pt wide.
Sourcepub fn anchor(self, anchor: Align2) -> Self
pub fn anchor(self, anchor: Align2) -> Self
Anchor corner for the stack. Default: Align2::RIGHT_BOTTOM.
Sourcepub fn offset(self, offset: impl Into<Vec2>) -> Self
pub fn offset(self, offset: impl Into<Vec2>) -> Self
Offset from the anchor corner, in points. Default: (12, 12).
Sourcepub fn max_visible(self, max_visible: usize) -> Self
pub fn max_visible(self, max_visible: usize) -> Self
Maximum number of toasts rendered at once. Oldest are dropped when the cap is exceeded. Default: 5.
Show a “Clear all” pill at the far end of the stack (above the
topmost toast for bottom-anchored stacks, below the bottommost
for top-anchored). Appears only when at least two non-dismissing
toasts are visible; clicking it starts the fade-out animation on
every entry at once. Default: false.