improv: remove double coloring of content_container windows

This sets the main content and the header bar to transparent when `content_container` is true, so that things aren't colored twice and overlayed on top of each other.
This ensures that modifying color alpha behaves as expected, especially for frosted glass.
This commit is contained in:
Vukašin Vojinović 2026-01-28 00:38:23 +01:00 committed by Jeremy Soller
parent 9fcd449611
commit b71a7c9edf
3 changed files with 13 additions and 2 deletions

View file

@ -28,6 +28,7 @@ pub fn header_bar<'a, Message>() -> HeaderBar<'a, Message> {
is_ssd: false,
on_double_click: None,
is_condensed: false,
transparent: false,
}
}
@ -92,6 +93,9 @@ pub struct HeaderBar<'a, Message> {
/// Whether the headerbar should be compact
is_condensed: bool,
/// Whether the headerbar should be transparent
transparent: bool,
}
impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
@ -412,6 +416,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
.class(crate::theme::Container::HeaderBar {
focused: self.focused,
sharp_corners: self.sharp_corners,
transparent: self.transparent,
})
.center_y(Length::Shrink)
.apply(widget::mouse_area);