stack: Fix round corners on maximize

This commit is contained in:
Victoria Brekenfeld 2024-08-02 20:48:33 +02:00
parent 5aaac707f8
commit c3524d3546

View file

@ -929,38 +929,39 @@ impl Program for CosmicStackInternal {
.into(), .into(),
]; ];
let radius = if windows[active].is_maximized(false) {
Radius::from(0.0)
} else {
Radius::from([8.0, 8.0, 0.0, 0.0])
};
let group_focused = self.group_focused.load(Ordering::SeqCst);
iced_widget::row(elements) iced_widget::row(elements)
.height(TAB_HEIGHT as u16) .height(TAB_HEIGHT as u16)
.width(Length::Fill) //width as u16) .width(Length::Fill) //width as u16)
.apply(iced_widget::container) .apply(iced_widget::container)
.center_y() .center_y()
.style(if self.group_focused.load(Ordering::SeqCst) { .style(theme::Container::custom(move |theme| {
theme::Container::custom(|theme| iced_widget::container::Appearance { let background = if group_focused {
icon_color: Some(Color::from(theme.cosmic().background.on)), Some(Background::Color(theme.cosmic().accent_color().into()))
text_color: Some(Color::from(theme.cosmic().background.on)), } else {
background: Some(Background::Color(theme.cosmic().accent_color().into())), Some(Background::Color(tab::primary_container_color(
border: Border {
radius: Radius::from([8.0, 8.0, 0.0, 0.0]),
width: 0.0,
color: Color::TRANSPARENT,
},
shadow: Default::default(),
})
} else {
theme::Container::custom(|theme| iced_widget::container::Appearance {
icon_color: Some(Color::from(theme.cosmic().background.on)),
text_color: Some(Color::from(theme.cosmic().background.on)),
background: Some(Background::Color(tab::primary_container_color(
theme.cosmic(), theme.cosmic(),
))), )))
};
iced_widget::container::Appearance {
icon_color: Some(Color::from(theme.cosmic().background.on)),
text_color: Some(Color::from(theme.cosmic().background.on)),
background,
border: Border { border: Border {
radius: Radius::from([8.0, 8.0, 0.0, 0.0]), radius,
width: 0.0, width: 0.0,
color: Color::TRANSPARENT, color: Color::TRANSPARENT,
}, },
shadow: Default::default(), shadow: Default::default(),
}) }
}) }))
.into() .into()
} }