Revert "remove header container"

This reverts commit 8035ef9535fa87deb05d88594a6b6a412324c039.
This commit is contained in:
Ashley Wulber 2026-05-05 13:11:35 -04:00 committed by Ashley Wulber
parent 7d62b193f4
commit 40792f21de

View file

@ -815,7 +815,33 @@ impl<App: Application> ApplicationExt for App {
header = header.end(element.map(crate::Action::App));
}
header.apply(|w| id_container(w, iced_core::id::Id::new("COSMIC_header")))
if content_container {
header.apply(|w| id_container(w, iced_core::id::Id::new("COSMIC_header")))
} else {
// Needed to avoid header bar corner gaps for apps without a content container
header
.apply(container)
.class(crate::theme::Container::custom(move |theme| {
let cosmic = theme.cosmic();
container::Style {
background: Some(iced::Background::Color(
cosmic.background(theme.transparent).base.into(),
)),
border: iced::Border {
radius: [
(window_corner_radius[0] - 1.0).max(0.0),
(window_corner_radius[1] - 1.0).max(0.0),
cosmic.radius_0()[2],
cosmic.radius_0()[3],
]
.into(),
..Default::default()
},
..Default::default()
}
}))
.apply(|w| id_container(w, iced_core::id::Id::new("COSMIC_header")))
}
})
} else {
None