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 4fa39e5ea3
commit ba1232cffc
5 changed files with 22 additions and 47 deletions

View file

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

View file

@ -63,20 +63,12 @@ impl From<TabBackgroundTheme> for theme::Container<'_> {
snap: true, snap: true,
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(
let mut color = theme theme.cosmic().primary(false).component.selected.into(),
.cosmic() )),
.primary(theme.cosmic().frosted_windows) background: Some(Background::Color(
.component theme.cosmic().primary(false).component.selected.into(),
.selected; )),
if theme.cosmic().frosted_windows {
color.alpha = theme
.cosmic()
.alpha_map
.blurred_alpha(theme.cosmic().frosted);
}
color.into()
})),
border: Border { border: Border {
radius: 0.0.into(), radius: 0.0.into(),
width: 0.0, width: 0.0,
@ -90,20 +82,12 @@ impl From<TabBackgroundTheme> for theme::Container<'_> {
snap: true, snap: true,
icon_color: None, icon_color: None,
text_color: None, text_color: None,
background: Some(Background::Color({ background: Some(Background::Color(
let mut color = theme theme.cosmic().primary(false).component.base.into(),
.cosmic() )),
.primary(theme.cosmic().frosted_windows) background: Some(Background::Color(
.component theme.cosmic().primary(false).component.base.into(),
.base; )),
if theme.cosmic().frosted_windows {
color.alpha = theme
.cosmic()
.alpha_map
.blurred_alpha(theme.cosmic().frosted);
}
color.into()
})),
border: Border { border: Border {
radius: 0.0.into(), radius: 0.0.into(),
width: 0.0, width: 0.0,

View file

@ -831,11 +831,8 @@ 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 theme.cosmic().background(false).base.into()
.cosmic() theme.cosmic().background(false).base.into()
.background(theme.cosmic().frosted_windows)
.base
.into()
} else { } else {
Color::TRANSPARENT Color::TRANSPARENT
} }

View file

@ -484,7 +484,8 @@ 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(theme.cosmic().frosted_windows).component; let component = &cosmic.background(false).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

@ -504,7 +504,8 @@ 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(theme.transparent).component; let component = &cosmic.background(false).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()),