use iced_dialog::dialog::{Catalog, Style, StyleFn}; use iced_widget::container; use iced_widget::core::{Background, border}; use super::{Theme, text}; impl Catalog for Theme { type Class<'a> = StyleFn<'a, Self>; fn default<'a>() -> ::Class<'a> { Box::new(default) } fn default_container<'a>() -> ::Class<'a> { Box::new(default_container) } fn default_title<'a>() -> ::Class<'a> { Box::new(text::surface) } fn style(&self, class: &::Class<'_>) -> Style { class(self) } } pub fn default_container(theme: &Theme) -> container::Style { let colors = theme.colors().surface; container::Style { background: Some(Background::Color(colors.container.high)), text_color: Some(colors.text_variant), border: border::rounded(28), ..container::Style::default() } } pub fn default(theme: &Theme) -> Style { Style { backdrop_color: theme.colors().scrim, } }