use super::{SurfaceStyle, TypographyRole};
use crate::{Color, Padding};
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct ModalStyle {
pub overlay: Option<Color>,
pub overlay_blur: Option<f32>,
pub surface: SurfaceStyle,
pub padding: Option<Padding>,
pub gap: Option<f32>,
pub spacing: Option<f32>,
pub min_width: Option<f32>,
pub max_width: Option<f32>,
pub margin: Option<f32>,
pub enter_scale: Option<f32>,
pub enter_offset: Option<f32>,
pub title: Option<TypographyRole>,
pub description: Option<TypographyRole>,
pub close_size: Option<f32>,
}
impl ModalStyle {
pub(crate) fn merge(&mut self, rhs: Self) {
macro_rules! set { ($($f:ident),*) => { $(if rhs.$f.is_some() { self.$f = rhs.$f; })* }; }
set!(
overlay,
overlay_blur,
padding,
gap,
spacing,
min_width,
max_width,
margin,
enter_scale,
enter_offset,
title,
description,
close_size
);
self.surface.merge(rhs.surface);
}
}