From 495985f449e46b24e6b734d3aa9e135a779a8b77 Mon Sep 17 00:00:00 2001 From: pml68 Date: Sun, 13 Apr 2025 03:40:38 +0200 Subject: refactor: move `material_theme` and `iced_drop` into separate crates dir --- crates/material_theme/src/dialog.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 crates/material_theme/src/dialog.rs (limited to 'crates/material_theme/src/dialog.rs') diff --git a/crates/material_theme/src/dialog.rs b/crates/material_theme/src/dialog.rs new file mode 100644 index 0000000..68c61b5 --- /dev/null +++ b/crates/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>() + -> ::Class<'a> { + Box::new(default_container) + } + + fn default_title<'a>() -> ::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() + } +} -- cgit v1.2.3