From a46483f161ee4bfc13e14288fbf07757bc469766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= Date: Sun, 18 May 2025 19:24:27 +0200 Subject: [PATCH] fix(header_bar): add `is_ssd` field --- src/widget/header_bar.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/widget/header_bar.rs b/src/widget/header_bar.rs index 1d19f095..fdc9d962 100644 --- a/src/widget/header_bar.rs +++ b/src/widget/header_bar.rs @@ -24,6 +24,7 @@ pub fn header_bar<'a, Message>() -> HeaderBar<'a, Message> { density: None, focused: false, maximized: false, + is_ssd: false, on_double_click: None, } } @@ -80,6 +81,9 @@ pub struct HeaderBar<'a, Message> { /// Maximized state of the window maximized: bool, + + /// HeaderBar used for server-side decorations + is_ssd: bool, } impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> { @@ -363,7 +367,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> { ) .align_y(iced::Alignment::Center) .height(Length::Fixed(32.0 + padding[0] as f32 + padding[2] as f32)) - .padding(padding) + .padding(if self.is_ssd { [0, 8, 0, 8] } else { padding }) .spacing(8) .apply(widget::container) .class(crate::theme::Container::HeaderBar {