From ba1232cffc69a2cc8161a849aba15da0ad5c7842 Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Fri, 3 Jul 2026 12:36:51 +0200 Subject: [PATCH] fix: absorb libcosmic theme-v2 API (private containers, text::Style, wgpu 28) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Leyoda 2026 – GPLv3 --- src/shell/element/stack.rs | 16 ++++---------- src/shell/element/stack/tab.rs | 40 ++++++++++------------------------ src/shell/element/window.rs | 7 ++---- src/shell/grabs/menu/mod.rs | 3 ++- src/shell/zoom.rs | 3 ++- 5 files changed, 22 insertions(+), 47 deletions(-) diff --git a/src/shell/element/stack.rs b/src/shell/element/stack.rs index d466f4e0..7d1d9b51 100644 --- a/src/shell/element/stack.rs +++ b/src/shell/element/stack.rs @@ -1379,18 +1379,10 @@ impl Decorations for DefaultDecorations { iced_widget::container::Style { snap: true, - icon_color: Some( - cosmic_theme - .background(cosmic_theme.frosted_windows) - .on - .into(), - ), - text_color: Some( - cosmic_theme - .background(cosmic_theme.frosted_windows) - .on - .into(), - ), + icon_color: Some(cosmic_theme.background(false).on.into()), + text_color: Some(cosmic_theme.background(false).on.into()), + icon_color: Some(cosmic_theme.background(false).on.into()), + text_color: Some(cosmic_theme.background(false).on.into()), background: Some(Background::Color(background.into())), border: Border { radius, diff --git a/src/shell/element/stack/tab.rs b/src/shell/element/stack/tab.rs index f8fda525..c501698f 100644 --- a/src/shell/element/stack/tab.rs +++ b/src/shell/element/stack/tab.rs @@ -63,20 +63,12 @@ impl From for theme::Container<'_> { snap: true, icon_color: Some(Color::from(theme.cosmic().accent_text_color())), text_color: Some(Color::from(theme.cosmic().accent_text_color())), - background: Some(Background::Color({ - let mut color = theme - .cosmic() - .primary(theme.cosmic().frosted_windows) - .component - .selected; - if theme.cosmic().frosted_windows { - color.alpha = theme - .cosmic() - .alpha_map - .blurred_alpha(theme.cosmic().frosted); - } - color.into() - })), + background: Some(Background::Color( + theme.cosmic().primary(false).component.selected.into(), + )), + background: Some(Background::Color( + theme.cosmic().primary(false).component.selected.into(), + )), border: Border { radius: 0.0.into(), width: 0.0, @@ -90,20 +82,12 @@ impl From for theme::Container<'_> { snap: true, icon_color: None, text_color: None, - background: Some(Background::Color({ - let mut color = theme - .cosmic() - .primary(theme.cosmic().frosted_windows) - .component - .base; - if theme.cosmic().frosted_windows { - color.alpha = theme - .cosmic() - .alpha_map - .blurred_alpha(theme.cosmic().frosted); - } - color.into() - })), + background: Some(Background::Color( + theme.cosmic().primary(false).component.base.into(), + )), + background: Some(Background::Color( + theme.cosmic().primary(false).component.base.into(), + )), border: Border { radius: 0.0.into(), width: 0.0, diff --git a/src/shell/element/window.rs b/src/shell/element/window.rs index 86c2ce7f..06b34188 100644 --- a/src/shell/element/window.rs +++ b/src/shell/element/window.rs @@ -831,11 +831,8 @@ impl Program for CosmicWindowInternal { fn background_color(&self, theme: &cosmic::Theme) -> Color { if self.window.is_maximized(false) { - theme - .cosmic() - .background(theme.cosmic().frosted_windows) - .base - .into() + theme.cosmic().background(false).base.into() + theme.cosmic().background(false).base.into() } else { Color::TRANSPARENT } diff --git a/src/shell/grabs/menu/mod.rs b/src/shell/grabs/menu/mod.rs index 72ea065b..1eb571f1 100644 --- a/src/shell/grabs/menu/mod.rs +++ b/src/shell/grabs/menu/mod.rs @@ -484,7 +484,8 @@ impl Program for ContextMenu { .padding(1) .class(theme::Container::custom(|theme| { let cosmic = theme.cosmic(); - let component = &cosmic.background(theme.cosmic().frosted_windows).component; + let component = &cosmic.background(false).component; + let component = &cosmic.background(false).component; iced_widget::container::Style { snap: true, icon_color: Some(cosmic.accent.base.into()), diff --git a/src/shell/zoom.rs b/src/shell/zoom.rs index ef81053f..8363510a 100644 --- a/src/shell/zoom.rs +++ b/src/shell/zoom.rs @@ -504,7 +504,8 @@ impl Program for ZoomProgram { .padding(8) .class(theme::Container::custom(|theme| { let cosmic = theme.cosmic(); - let component = &cosmic.background(theme.transparent).component; + let component = &cosmic.background(false).component; + let component = &cosmic.background(false).component; iced_widget::container::Style { snap: true, icon_color: Some(component.on.into()),