fix(notifications): layout

This commit is contained in:
Ashley Wulber 2023-07-11 17:28:45 -04:00 committed by Ashley Wulber
parent 9cad9ba649
commit c8273f0b4d

View file

@ -359,31 +359,34 @@ impl Application for Notifications {
} }
None => row![app_name, duration_since], None => row![app_name, duration_since],
}, },
text(if n.summary.len() > 77 { column![
Cow::from(format!( text(if n.summary.len() > 77 {
"{:.80}...", Cow::from(format!(
n.summary.lines().next().unwrap_or_default() "{:.80}...",
)) n.summary.lines().next().unwrap_or_default()
} else { ))
Cow::from(&n.summary) } else {
}) Cow::from(&n.summary)
.size(14) })
.width(Length::Fixed(300.0)), .width(Length::Fill)
text(if n.body.len() > 77 { .size(14),
Cow::from(format!( text(if n.body.len() > 77 {
"{:.80}...", Cow::from(format!(
n.body.lines().next().unwrap_or_default() "{:.80}...",
)) n.body.lines().next().unwrap_or_default()
} else { ))
Cow::from(&n.body) } else {
}) Cow::from(&n.body)
.size(12) })
.width(Length::Fixed(300.0)), .width(Length::Fill)
.size(12)
]
) )
.spacing(8) .spacing(8)
.into()]) .into()])
.padding(16) .padding(16)
.on_press(Message::Dismissed(n.id)) .on_press(Message::Dismissed(n.id))
.width(Length::Fill)
.into(), .into(),
); );
} }