fix(context_drawer): adjust header to avoid text wrapping
This commit is contained in:
parent
989fcad99e
commit
6a5076ecb7
1 changed files with 18 additions and 9 deletions
|
|
@ -57,23 +57,32 @@ impl<'a, Message: Clone + 'static> ContextDrawer<'a, Message> {
|
||||||
|
|
||||||
let horizontal_padding = if max_width < 392.0 { space_s } else { space_l };
|
let horizontal_padding = if max_width < 392.0 { space_s } else { space_l };
|
||||||
|
|
||||||
|
let title =
|
||||||
|
title.map(|title| text::heading(title).width(Length::FillPortion(3)).center());
|
||||||
|
|
||||||
|
let close_width = if title.is_some() {
|
||||||
|
Length::FillPortion(1)
|
||||||
|
} else {
|
||||||
|
Length::Shrink
|
||||||
|
};
|
||||||
|
|
||||||
let header_row = row::with_capacity(3)
|
let header_row = row::with_capacity(3)
|
||||||
.width(Length::Fixed(480.0))
|
.width(Length::Fixed(480.0))
|
||||||
.align_y(Alignment::Center)
|
.align_y(Alignment::Center)
|
||||||
.push(
|
.push(row::with_children(header_actions).spacing(space_xxs).width(
|
||||||
row::with_children(header_actions)
|
if title.is_some() {
|
||||||
.spacing(space_xxs)
|
Length::FillPortion(1)
|
||||||
.width(Length::FillPortion(1)),
|
} else {
|
||||||
)
|
Length::Fill
|
||||||
.push_maybe(
|
},
|
||||||
title.map(|title| text::heading(title).width(Length::FillPortion(1)).center()),
|
))
|
||||||
)
|
.push_maybe(title)
|
||||||
.push(
|
.push(
|
||||||
button::text("Close")
|
button::text("Close")
|
||||||
.trailing_icon(icon::from_name("go-next-symbolic"))
|
.trailing_icon(icon::from_name("go-next-symbolic"))
|
||||||
.on_press(on_close)
|
.on_press(on_close)
|
||||||
.apply(container)
|
.apply(container)
|
||||||
.width(Length::FillPortion(1))
|
.width(close_width)
|
||||||
.align_x(Alignment::End),
|
.align_x(Alignment::End),
|
||||||
);
|
);
|
||||||
let header = column::with_capacity(2)
|
let header = column::with_capacity(2)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue