diff options
Diffstat (limited to '')
| -rw-r--r-- | material_theme/src/dialog.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/material_theme/src/dialog.rs b/material_theme/src/dialog.rs new file mode 100644 index 0000000..68c61b5 --- /dev/null +++ b/material_theme/src/dialog.rs @@ -0,0 +1,25 @@ +use iced_widget::container::Style; +use iced_widget::core::{Background, border}; + +use super::{Theme, text}; + +impl iced_dialog::dialog::Catalog for Theme { + fn default_container<'a>() + -> <Self as iced_widget::container::Catalog>::Class<'a> { + Box::new(default_container) + } + + fn default_title<'a>() -> <Self as iced_widget::text::Catalog>::Class<'a> { + Box::new(text::surface) + } +} + +pub fn default_container(theme: &Theme) -> Style { + let colors = theme.colorscheme.surface; + Style { + background: Some(Background::Color(colors.surface_container.high)), + text_color: Some(colors.on_surface_variant), + border: border::rounded(28), + ..Style::default() + } +} |
