chore: add shade color to theme
This commit is contained in:
parent
a0340aac26
commit
a09f4601ee
1 changed files with 12 additions and 0 deletions
|
|
@ -92,6 +92,8 @@ pub struct Theme {
|
||||||
pub window_hint: Option<Srgb>,
|
pub window_hint: Option<Srgb>,
|
||||||
/// enables blurred transparency
|
/// enables blurred transparency
|
||||||
pub is_frosted: bool,
|
pub is_frosted: bool,
|
||||||
|
/// shade color for dialogs
|
||||||
|
pub shade: Srgba,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Theme {
|
impl Default for Theme {
|
||||||
|
|
@ -372,6 +374,11 @@ impl Theme {
|
||||||
self.corner_radii.radius_xl
|
self.corner_radii.radius_xl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// get @shade_color
|
||||||
|
pub fn shade_color(&self) -> Srgba {
|
||||||
|
self.shade
|
||||||
|
}
|
||||||
|
|
||||||
/// get the active theme
|
/// get the active theme
|
||||||
pub fn get_active() -> Result<Self, (Vec<cosmic_config::Error>, Self)> {
|
pub fn get_active() -> Result<Self, (Vec<cosmic_config::Error>, Self)> {
|
||||||
let config =
|
let config =
|
||||||
|
|
@ -738,6 +745,11 @@ impl ThemeBuilder {
|
||||||
|
|
||||||
let mut theme: Theme = Theme {
|
let mut theme: Theme = Theme {
|
||||||
name: palette.name().to_string(),
|
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: Container::new(
|
||||||
primary_component,
|
primary_component,
|
||||||
primary_container_bg,
|
primary_container_bg,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue