Skip to content

Commit

Permalink
fix(headerbar): center-align title even if start region is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mmstick committed Nov 1, 2023
1 parent 80d2078 commit 34c0ac3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/widget/header_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 34c0ac3

Please sign in to comment.