From 9141780b3036268e38d4d58345cbe892e951f6d8 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 | 4 ++-- src/shell/element/stack/tab.rs | 4 ++-- src/shell/element/window.rs | 2 +- src/shell/grabs/menu/mod.rs | 8 +++++--- src/shell/zoom.rs | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/shell/element/stack.rs b/src/shell/element/stack.rs index 9f8584f5..058719e3 100644 --- a/src/shell/element/stack.rs +++ b/src/shell/element/stack.rs @@ -1364,8 +1364,8 @@ impl Decorations for DefaultDecorations { iced_widget::container::Style { snap: true, - icon_color: Some(cosmic_theme.background.on.into()), - text_color: Some(cosmic_theme.background.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 99b0c247..ea48a585 100644 --- a/src/shell/element/stack/tab.rs +++ b/src/shell/element/stack/tab.rs @@ -65,7 +65,7 @@ impl From for theme::Container<'_> { icon_color: Some(Color::from(theme.cosmic().accent_text_color())), text_color: Some(Color::from(theme.cosmic().accent_text_color())), background: Some(Background::Color( - theme.cosmic().primary.component.selected.into(), + theme.cosmic().primary(false).component.selected.into(), )), border: Border { radius: 0.0.into(), @@ -81,7 +81,7 @@ impl From for theme::Container<'_> { icon_color: None, text_color: None, background: Some(Background::Color( - theme.cosmic().primary.component.base.into(), + theme.cosmic().primary(false).component.base.into(), )), border: Border { radius: 0.0.into(), diff --git a/src/shell/element/window.rs b/src/shell/element/window.rs index 0adbfab7..ea20bb6a 100644 --- a/src/shell/element/window.rs +++ b/src/shell/element/window.rs @@ -826,7 +826,7 @@ impl Program for CosmicWindowInternal { fn background_color(&self, theme: &cosmic::Theme) -> Color { if self.window.is_maximized(false) { - theme.cosmic().background.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 14a9f917..671e004a 100644 --- a/src/shell/grabs/menu/mod.rs +++ b/src/shell/grabs/menu/mod.rs @@ -428,10 +428,11 @@ impl Program for ContextMenu { .width(mode) .class(if *disabled { theme::Text::Custom(|theme| { - let mut color = theme.cosmic().background.component.on; + let mut color = theme.cosmic().background(false).component.on; color.alpha *= 0.5; TextStyle { color: Some(color.into()), + ..Default::default() } }) } else { @@ -446,10 +447,11 @@ impl Program for ContextMenu { .align_x(Horizontal::Right) .width(Length::Shrink) .class(theme::Text::Custom(|theme| { - let mut color = theme.cosmic().background.component.on; + let mut color = theme.cosmic().background(false).component.on; color.alpha *= 0.75; TextStyle { color: Some(color.into()), + ..Default::default() } })) .into(), @@ -474,7 +476,7 @@ impl Program for ContextMenu { .padding(1) .class(theme::Container::custom(|theme| { let cosmic = theme.cosmic(); - let component = &cosmic.background.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 ffeed63b..f72ad8e8 100644 --- a/src/shell/zoom.rs +++ b/src/shell/zoom.rs @@ -505,7 +505,7 @@ impl Program for ZoomProgram { .padding(8) .class(theme::Container::custom(|theme| { let cosmic = theme.cosmic(); - let component = &cosmic.background.component; + let component = &cosmic.background(false).component; iced_widget::container::Style { snap: true, icon_color: Some(component.on.into()),