improv: window border corner appearance

This commit is contained in:
Vukašin Vojinović 2024-11-25 02:36:11 +01:00 committed by Michael Murphy
parent a9c7c3cdbf
commit af7157b45a
2 changed files with 11 additions and 25 deletions

View file

@ -892,13 +892,17 @@ impl<App: Application> ApplicationExt for App {
.apply(container)
.padding(if sharp_corners { 0 } else { 1 })
.style(move |theme| container::Style {
icon_color: Some(iced::Color::from(theme.cosmic().background.on)),
text_color: Some(iced::Color::from(theme.cosmic().background.on)),
background: Some(iced::Background::Color(
theme.cosmic().background.base.into(),
)),
border: iced::Border {
color: theme.cosmic().bg_divider().into(),
width: if sharp_corners { 0.0 } else { 1.0 },
// x + 2.0 is used to prevent corner artifacts
radius: theme.cosmic().radius_s().map(|x| x + 2.0).into(),
radius: theme.cosmic().radius_s().into(),
},
..Default::default()
shadow: iced::Shadow::default(),
});
// Show any current dialog on top and centered over the view content