From 9ccd34b5abe860754e5d2aaec962f827cced2ead Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Wed, 1 Nov 2023 16:29:45 +0100 Subject: [PATCH] fix(headerbar): center-align title even if start region is empty --- src/widget/header_bar.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widget/header_bar.rs b/src/widget/header_bar.rs index d99de7f1..45bac890 100644 --- a/src/widget/header_bar.rs +++ b/src/widget/header_bar.rs @@ -101,13 +101,13 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> { // Creates the headerbar widget. let mut widget = widget::row::with_capacity(4) // If elements exist in the start region, append them here. - .push_maybe((!start.is_empty()).then(|| { + .push( widget::row::with_children(start) .align_items(iced::Alignment::Center) .apply(widget::container) .align_x(iced::alignment::Horizontal::Left) - .width(Length::Fill) - })) + .width(Length::Fill), + ) // If elements exist in the center region, use them here. // This will otherwise use the title as a widget if a title was defined. .push(if !center.is_empty() {