diff --git a/src/app/mod.rs b/src/app/mod.rs index f78beac..ad1ceef 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -773,7 +773,6 @@ impl ApplicationExt for App { .focused(focused) .maximized(maximized) .sharp_corners(sharp_corners) - .transparent(content_container) .title(&core.window.header_title) .on_drag(crate::Action::Cosmic(Action::Drag)) .on_right_click(crate::Action::Cosmic(Action::ShowWindowMenu)) diff --git a/src/widget/header_bar.rs b/src/widget/header_bar.rs index a772f7d..0a10b0a 100644 --- a/src/widget/header_bar.rs +++ b/src/widget/header_bar.rs @@ -26,7 +26,6 @@ pub fn header_bar<'a, Message>() -> HeaderBar<'a, Message> { sharp_corners: false, is_ssd: false, on_double_click: None, - transparent: false, } } @@ -88,9 +87,6 @@ pub struct HeaderBar<'a, Message> { /// HeaderBar used for server-side decorations is_ssd: bool, - - /// Whether the headerbar should be transparent - transparent: bool, } impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> { @@ -370,6 +366,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> { space_xxs, .. } = theme::spacing(); + let is_ssd = self.is_ssd; // Take ownership of the regions to be packed. let start = std::mem::take(&mut self.start); @@ -379,7 +376,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> { // Also packs the window controls at the very end. end.push(self.window_controls(space_xxs)); - let padding = if self.is_ssd { + let padding = if is_ssd { [2, 8, 2, 8] } else { match ( @@ -424,7 +421,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> { .class(theme::Container::HeaderBar { focused: self.focused, sharp_corners: self.sharp_corners, - transparent: self.transparent, + transparent: if is_ssd { false } else { true }, }) .height(Length::Fixed(32.0 + padding[0] as f32 + padding[2] as f32)) .padding(padding)