pub struct ToastStyle {Show 20 fields
pub background: Color,
pub border: Border,
pub shadows: Vec<BoxShadow>,
pub title_text: TextStyle,
pub description_text: TextStyle,
pub close_tint: Color,
pub neutral: Color,
pub success: Color,
pub warning: Color,
pub danger: Color,
pub info: Color,
pub radius: Radius,
pub width: f32,
pub padding_x: f32,
pub padding_y: f32,
pub gap: f32,
pub icon_size: f32,
pub close_size: f32,
pub stack_gap: f32,
pub inset: f32,
}Expand description
Resolved toast colors, typography, and logical-pixel geometry.
Toast heights are fixed at 52 pixels without a description and 72 pixels
with one. padding_y is retained for style compatibility but those fixed
vertical offsets currently do not read it.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::ToastStyle;
let style = ToastStyle::from_theme(Theme::dark());
assert_eq!(style.width, 330.0);
assert_eq!(style.inset, 18.0);Fields§
§background: ColorCard fill.
border: BorderCard border.
shadows: Vec<BoxShadow>Card shadows; inset entries are skipped.
title_text: TextStyleTitle text style.
description_text: TextStyleDescription text style.
close_tint: ColorClose-icon tint before the fixed 0.82 opacity multiplier.
neutral: ColorNeutral tone-strip and icon color.
success: ColorSuccess tone-strip and icon color.
warning: ColorWarning tone-strip and icon color.
danger: ColorDanger tone-strip and icon color.
info: ColorInfo tone-strip and icon color.
radius: RadiusCard corner radii.
width: f32Toast width in logical pixels.
padding_x: f32Horizontal text/icon inset in logical pixels.
padding_y: f32Reserved vertical padding; fixed toast offsets currently ignore it.
gap: f32Gap between leading icon/text and text/close regions.
icon_size: f32Leading icon width and height.
close_size: f32Close hit/icon width and height.
stack_gap: f32Gap between stacked toast rectangles.
inset: f32Distance from the selected host edges.
Implementations§
Source§impl ToastStyle
impl ToastStyle
Sourcepub fn from_theme(theme: Theme) -> Self
pub fn from_theme(theme: Theme) -> Self
Resolves toast colors, typography, and geometry from theme.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::ToastStyle;
let style = ToastStyle::from_theme(Theme::dark());
assert_eq!(style.icon_size, 16.0);
assert_eq!(style.stack_gap, 10.0);Sourcepub fn tone_color(&self, tone: ToastTone) -> Color
pub fn tone_color(&self, tone: ToastTone) -> Color
Returns the configured accent color for tone.
§Examples
use ailloli_ui_widgets::controls::{ToastStyle, ToastTone};
let style = ToastStyle::default();
assert_eq!(style.tone_color(ToastTone::Success), style.success);Trait Implementations§
Source§impl Clone for ToastStyle
impl Clone for ToastStyle
Source§fn clone(&self) -> ToastStyle
fn clone(&self) -> ToastStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToastStyle
impl Debug for ToastStyle
Source§impl Default for ToastStyle
impl Default for ToastStyle
Source§impl PartialEq for ToastStyle
impl PartialEq for ToastStyle
impl StructuralPartialEq for ToastStyle
Auto Trait Implementations§
impl Freeze for ToastStyle
impl RefUnwindSafe for ToastStyle
impl Send for ToastStyle
impl Sync for ToastStyle
impl Unpin for ToastStyle
impl UnwindSafe for ToastStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.