Use ellipsizing and replace chrono with jiff (#1323)

* refactor(time): use `jiff` instead of `chrono`

* improv: use text ellipsizing
This commit is contained in:
Vukašin Vojinović 2026-03-03 23:57:49 +01:00 committed by GitHub
parent 02b035ce93
commit 7029fcccf6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 708 additions and 530 deletions

View file

@ -14,6 +14,7 @@ use cosmic::{
cosmic_theme::Spacing,
iced::{
Alignment, Length, Subscription,
advanced::text::{Ellipsize, EllipsizeHeightLimit},
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
widget::{column, row},
window,
@ -457,15 +458,9 @@ impl cosmic::Application for Notifications {
.iter()
.rev()
.map(|n| {
let app_name = text::caption(if n.app_name.len() > 24 {
Cow::from(format!(
"{:.26}...",
n.app_name.lines().next().unwrap_or_default()
))
} else {
Cow::from(&n.app_name)
})
.width(Length::Fill);
let app_name = text::caption(Cow::from(&n.app_name))
.ellipsize(Ellipsize::End(EllipsizeHeightLimit::Lines(1)))
.width(Length::Fill);
let duration_since = text::caption(duration_ago_msg(n));