summaryrefslogtreecommitdiff
path: root/crates/material_theme/src/dialog.rs
blob: 68c61b55dd9cb99a1484473c9b360a5eddac0ee2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()
    }
}