From 0ca1b784c931c946517379795ce87328c6a902b8 Mon Sep 17 00:00:00 2001 From: vacenty <193441458+vacenty@users.noreply.github.com> Date: Thu, 16 Jul 2026 00:52:57 +0200 Subject: [PATCH] feat: Add option for frozen glass in maximized windows --- cosmic-theme/src/model/theme.rs | 9 +++++++++ src/app/cosmic.rs | 16 ++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/cosmic-theme/src/model/theme.rs b/cosmic-theme/src/model/theme.rs index 77f94c8f..5974523b 100644 --- a/cosmic-theme/src/model/theme.rs +++ b/cosmic-theme/src/model/theme.rs @@ -121,6 +121,9 @@ pub struct Theme { /// frosted applet popups pub frosted_applets: bool, #[serde(default)] + /// frosted apps when maximized + pub frosted_maximized_apps: bool, + #[serde(default)] /// alpha map pub alpha_map: AlphaMap, /// shade color for dialogs @@ -909,6 +912,9 @@ pub struct ThemeBuilder { /// frosted applet popups pub frosted_applets: bool, #[serde(default)] + /// frosted apps when maximized + pub frosted_maximized_apps: bool, + #[serde(default)] /// alpha map pub alpha_map: AlphaMap, } @@ -937,6 +943,7 @@ impl Default for ThemeBuilder { frosted_system_interface: false, frosted_panel: false, frosted_applets: false, + frosted_maximized_apps: false, alpha_map: AlphaMap::default(), } } @@ -1084,6 +1091,7 @@ impl ThemeBuilder { frosted_system_interface, frosted_panel, frosted_applets, + frosted_maximized_apps, alpha_map, } = self; @@ -1556,6 +1564,7 @@ impl ThemeBuilder { frosted_system_interface, frosted_panel, frosted_applets, + frosted_maximized_apps, alpha_map, transparent_background: Container::new( Component::component( diff --git a/src/app/cosmic.rs b/src/app/cosmic.rs index eddf34bd..d31b6088 100644 --- a/src/app/cosmic.rs +++ b/src/app/cosmic.rs @@ -549,16 +549,16 @@ where pub fn style(&self, theme: &Theme) -> theme::Style { if let Some(style) = self.app.style() { style - } else if self.app.core().window.is_maximized { - let theme = THEME.lock().unwrap(); - crate::style::iced::application::style(theme.borrow()) } else { let theme = THEME.lock().unwrap(); - - theme::Style { - background_color: iced_core::Color::TRANSPARENT, - icon_color: theme.cosmic().on_bg_color().into(), - text_color: theme.cosmic().on_bg_color().into(), + if self.app.core().window.is_maximized && !theme.cosmic().frosted_maximized_apps { + crate::style::iced::application::style(theme.borrow()) + } else { + theme::Style { + background_color: iced_core::Color::TRANSPARENT, + icon_color: theme.cosmic().on_bg_color().into(), + text_color: theme.cosmic().on_bg_color().into(), + } } } }