From bd35a99b5cf13c5c481159ca45e890b5845e90e3 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Fri, 6 Oct 2023 15:12:46 -0400 Subject: [PATCH] feat: add more variables to the theme --- cosmic-theme/src/model/theme.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/cosmic-theme/src/model/theme.rs b/cosmic-theme/src/model/theme.rs index 1be057a8..7a2df559 100644 --- a/cosmic-theme/src/model/theme.rs +++ b/cosmic-theme/src/model/theme.rs @@ -76,6 +76,14 @@ pub struct Theme { pub is_dark: bool, /// is high contrast pub is_high_contrast: bool, + /// cosmic-comp window gaps size (outer, inner) + pub gaps: (u32, u32), + /// cosmic-comp active hint window outline width + pub active_hint: u32, + /// cosmic-comp custom window hint color + pub window_hint: Option, + /// enables blurred transparency + pub is_frosted: bool, } impl cosmic_config::CosmicConfigEntry for Theme { @@ -491,6 +499,14 @@ pub struct ThemeBuilder { pub warning: Option, /// override the destructive color for the builder pub destructive: Option, + /// enabled blurred transparency + pub is_frosted: bool, // TODO handle + /// cosmic-comp window gaps size (outer, inner) + pub gaps: (u32, u32), + /// cosmic-comp active hint window outline width + pub active_hint: u32, + /// cosmic-comp custom window hint color + pub window_hint: Option, } impl Default for ThemeBuilder { @@ -508,6 +524,11 @@ impl Default for ThemeBuilder { success: Default::default(), warning: Default::default(), destructive: Default::default(), + is_frosted: false, + // cosmic-comp theme settings + gaps: (0, 4), + active_hint: 4, + window_hint: None, } } } @@ -630,6 +651,10 @@ impl ThemeBuilder { success, warning, destructive, + gaps, + active_hint, + window_hint, + is_frosted, } = self; let is_dark = palette.is_dark(); @@ -940,6 +965,10 @@ impl ThemeBuilder { corner_radii, is_dark, is_high_contrast, + gaps, + active_hint, + window_hint, + is_frosted, }; theme.spacing = spacing; theme.corner_radii = corner_radii;