fix: absorb libcosmic theme-v2 API (private containers, text::Style, wgpu 28)

Leyoda 2026 – GPLv3
This commit is contained in:
Lionel DARNIS 2026-07-03 12:36:51 +02:00
parent 58b0598de8
commit 9141780b30
5 changed files with 11 additions and 9 deletions

View file

@ -1364,8 +1364,8 @@ impl Decorations<CosmicStackInternal, Message> for DefaultDecorations {
iced_widget::container::Style { iced_widget::container::Style {
snap: true, snap: true,
icon_color: Some(cosmic_theme.background.on.into()), icon_color: Some(cosmic_theme.background(false).on.into()),
text_color: Some(cosmic_theme.background.on.into()), text_color: Some(cosmic_theme.background(false).on.into()),
background: Some(Background::Color(background.into())), background: Some(Background::Color(background.into())),
border: Border { border: Border {
radius, radius,

View file

@ -65,7 +65,7 @@ impl From<TabBackgroundTheme> for theme::Container<'_> {
icon_color: Some(Color::from(theme.cosmic().accent_text_color())), icon_color: Some(Color::from(theme.cosmic().accent_text_color())),
text_color: Some(Color::from(theme.cosmic().accent_text_color())), text_color: Some(Color::from(theme.cosmic().accent_text_color())),
background: Some(Background::Color( background: Some(Background::Color(
theme.cosmic().primary.component.selected.into(), theme.cosmic().primary(false).component.selected.into(),
)), )),
border: Border { border: Border {
radius: 0.0.into(), radius: 0.0.into(),
@ -81,7 +81,7 @@ impl From<TabBackgroundTheme> for theme::Container<'_> {
icon_color: None, icon_color: None,
text_color: None, text_color: None,
background: Some(Background::Color( background: Some(Background::Color(
theme.cosmic().primary.component.base.into(), theme.cosmic().primary(false).component.base.into(),
)), )),
border: Border { border: Border {
radius: 0.0.into(), radius: 0.0.into(),

View file

@ -826,7 +826,7 @@ impl Program for CosmicWindowInternal {
fn background_color(&self, theme: &cosmic::Theme) -> Color { fn background_color(&self, theme: &cosmic::Theme) -> Color {
if self.window.is_maximized(false) { if self.window.is_maximized(false) {
theme.cosmic().background.base.into() theme.cosmic().background(false).base.into()
} else { } else {
Color::TRANSPARENT Color::TRANSPARENT
} }

View file

@ -428,10 +428,11 @@ impl Program for ContextMenu {
.width(mode) .width(mode)
.class(if *disabled { .class(if *disabled {
theme::Text::Custom(|theme| { 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; color.alpha *= 0.5;
TextStyle { TextStyle {
color: Some(color.into()), color: Some(color.into()),
..Default::default()
} }
}) })
} else { } else {
@ -446,10 +447,11 @@ impl Program for ContextMenu {
.align_x(Horizontal::Right) .align_x(Horizontal::Right)
.width(Length::Shrink) .width(Length::Shrink)
.class(theme::Text::Custom(|theme| { .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; color.alpha *= 0.75;
TextStyle { TextStyle {
color: Some(color.into()), color: Some(color.into()),
..Default::default()
} }
})) }))
.into(), .into(),
@ -474,7 +476,7 @@ impl Program for ContextMenu {
.padding(1) .padding(1)
.class(theme::Container::custom(|theme| { .class(theme::Container::custom(|theme| {
let cosmic = theme.cosmic(); let cosmic = theme.cosmic();
let component = &cosmic.background.component; let component = &cosmic.background(false).component;
iced_widget::container::Style { iced_widget::container::Style {
snap: true, snap: true,
icon_color: Some(cosmic.accent.base.into()), icon_color: Some(cosmic.accent.base.into()),

View file

@ -505,7 +505,7 @@ impl Program for ZoomProgram {
.padding(8) .padding(8)
.class(theme::Container::custom(|theme| { .class(theme::Container::custom(|theme| {
let cosmic = theme.cosmic(); let cosmic = theme.cosmic();
let component = &cosmic.background.component; let component = &cosmic.background(false).component;
iced_widget::container::Style { iced_widget::container::Style {
snap: true, snap: true,
icon_color: Some(component.on.into()), icon_color: Some(component.on.into()),