chore: add shade color to theme

This commit is contained in:
Ashley Wulber 2024-02-26 18:26:01 -05:00 committed by Jeremy Soller
parent a0340aac26
commit a09f4601ee

View file

@ -92,6 +92,8 @@ pub struct Theme {
pub window_hint: Option<Srgb>,
/// enables blurred transparency
pub is_frosted: bool,
/// shade color for dialogs
pub shade: Srgba,
}
impl Default for Theme {
@ -372,6 +374,11 @@ impl Theme {
self.corner_radii.radius_xl
}
/// get @shade_color
pub fn shade_color(&self) -> Srgba {
self.shade
}
/// get the active theme
pub fn get_active() -> Result<Self, (Vec<cosmic_config::Error>, Self)> {
let config =
@ -738,6 +745,11 @@ impl ThemeBuilder {
let mut theme: Theme = Theme {
name: palette.name().to_string(),
shade: if palette.is_dark() {
Srgba::new(0., 0., 0., 0.32)
} else {
Srgba::new(0., 0., 0., 0.08)
},
primary: Container::new(
primary_component,
primary_container_bg,