fix(header_bar): prevent double coloring
This commit is contained in:
parent
dad5f1e273
commit
17291536a1
2 changed files with 3 additions and 7 deletions
|
|
@ -773,7 +773,6 @@ impl<App: Application> ApplicationExt for App {
|
||||||
.focused(focused)
|
.focused(focused)
|
||||||
.maximized(maximized)
|
.maximized(maximized)
|
||||||
.sharp_corners(sharp_corners)
|
.sharp_corners(sharp_corners)
|
||||||
.transparent(content_container)
|
|
||||||
.title(&core.window.header_title)
|
.title(&core.window.header_title)
|
||||||
.on_drag(crate::Action::Cosmic(Action::Drag))
|
.on_drag(crate::Action::Cosmic(Action::Drag))
|
||||||
.on_right_click(crate::Action::Cosmic(Action::ShowWindowMenu))
|
.on_right_click(crate::Action::Cosmic(Action::ShowWindowMenu))
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ pub fn header_bar<'a, Message>() -> HeaderBar<'a, Message> {
|
||||||
sharp_corners: false,
|
sharp_corners: false,
|
||||||
is_ssd: false,
|
is_ssd: false,
|
||||||
on_double_click: None,
|
on_double_click: None,
|
||||||
transparent: false,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,9 +87,6 @@ pub struct HeaderBar<'a, Message> {
|
||||||
|
|
||||||
/// HeaderBar used for server-side decorations
|
/// HeaderBar used for server-side decorations
|
||||||
is_ssd: bool,
|
is_ssd: bool,
|
||||||
|
|
||||||
/// Whether the headerbar should be transparent
|
|
||||||
transparent: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
||||||
|
|
@ -370,6 +366,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
||||||
space_xxs,
|
space_xxs,
|
||||||
..
|
..
|
||||||
} = theme::spacing();
|
} = theme::spacing();
|
||||||
|
let is_ssd = self.is_ssd;
|
||||||
|
|
||||||
// Take ownership of the regions to be packed.
|
// Take ownership of the regions to be packed.
|
||||||
let start = std::mem::take(&mut self.start);
|
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.
|
// Also packs the window controls at the very end.
|
||||||
end.push(self.window_controls(space_xxs));
|
end.push(self.window_controls(space_xxs));
|
||||||
|
|
||||||
let padding = if self.is_ssd {
|
let padding = if is_ssd {
|
||||||
[2, 8, 2, 8]
|
[2, 8, 2, 8]
|
||||||
} else {
|
} else {
|
||||||
match (
|
match (
|
||||||
|
|
@ -424,7 +421,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
||||||
.class(theme::Container::HeaderBar {
|
.class(theme::Container::HeaderBar {
|
||||||
focused: self.focused,
|
focused: self.focused,
|
||||||
sharp_corners: self.sharp_corners,
|
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))
|
.height(Length::Fixed(32.0 + padding[0] as f32 + padding[2] as f32))
|
||||||
.padding(padding)
|
.padding(padding)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue