chore: theme-v2 libcosmic update

This commit is contained in:
Victoria Brekenfeld 2026-04-17 11:48:11 +02:00 committed by Victoria Brekenfeld
parent 667414bd92
commit 55d57ddba2
19 changed files with 609 additions and 386 deletions

View file

@ -6,8 +6,10 @@ use crate::{
use calloop::LoopHandle;
use cosmic::{
Apply,
iced::widget::{container, row, space},
iced_core::{Alignment, Background, Border, Color, Length},
iced::{
core::{Alignment, Background, Border, Color, Length},
widget::{container, row, space},
},
theme,
widget::{icon::from_name, text},
};
@ -43,17 +45,27 @@ impl Program for SwapIndicatorInternal {
.align_y(Alignment::Center)
.padding(16)
.apply(container)
.class(theme::Container::custom(|theme| container::Style {
snap: true,
icon_color: Some(Color::from(theme.cosmic().accent.on)),
text_color: Some(Color::from(theme.cosmic().accent.on)),
background: Some(Background::Color(theme.cosmic().accent_color().into())),
border: Border {
radius: 18.0.into(),
width: 0.0,
color: Color::TRANSPARENT,
},
shadow: Default::default(),
.class(theme::Container::custom(|theme| {
let mut background = theme.cosmic().accent_color();
if theme.transparent {
background.alpha = theme
.cosmic()
.alpha_map
.blurred_alpha(theme.cosmic().frosted);
}
container::Style {
snap: true,
icon_color: Some(Color::from(theme.cosmic().accent.on)),
text_color: Some(Color::from(theme.cosmic().accent.on)),
background: Some(Background::Color(background.into())),
border: Border {
radius: theme.cosmic().radius_s().into(),
width: 0.0,
color: Color::TRANSPARENT,
},
shadow: Default::default(),
}
}))
.width(Length::Shrink)
.height(Length::Shrink)