Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Jeremy Soller
ae3f722521
feat: use rich_text for notifications-applet (#1387)
Some checks failed
Continuous Integration / formatting (push) Has been cancelled
Continuous Integration / linting (push) Has been cancelled
Validate .desktop files / validate (push) Has been cancelled
2026-04-23 09:53:24 -06:00
Piotr
fc3c044c88 feat: use rich_text for notifications-applet 2026-04-20 12:28:11 +02:00

View file

@ -16,7 +16,7 @@ use cosmic::{
Alignment, Length, Subscription, Alignment, Length, Subscription,
advanced::text::{Ellipsize, EllipsizeHeightLimit}, advanced::text::{Ellipsize, EllipsizeHeightLimit},
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
widget::{self, column, row}, widget::{self, column, rich_text, row},
window, window,
}, },
surface, theme, surface, theme,
@ -26,7 +26,7 @@ use cosmic::{
use cosmic::iced::futures::executor::block_on; use cosmic::iced::futures::executor::block_on;
use cosmic_notifications_config::NotificationsConfig; use cosmic_notifications_config::NotificationsConfig;
use cosmic_notifications_util::{ActionId, Image, Notification}; use cosmic_notifications_util::{ActionId, Image, Notification, markup};
use std::{borrow::Cow, collections::HashMap, path::PathBuf, sync::LazyLock}; use std::{borrow::Cow, collections::HashMap, path::PathBuf, sync::LazyLock};
use subscriptions::notifications::{self, NotificationsAppletProxy}; use subscriptions::notifications::{self, NotificationsAppletProxy};
use tokio::sync::mpsc::Sender; use tokio::sync::mpsc::Sender;
@ -456,8 +456,11 @@ impl cosmic::Application for Notifications {
column![ column![
text::body(n.summary.lines().next().unwrap_or_default()) text::body(n.summary.lines().next().unwrap_or_default())
.width(Length::Fill), .width(Length::Fill),
text::caption(n.body.lines().next().unwrap_or_default()) Element::from(
.width(Length::Fill) rich_text(markup::html_to_spans(&n.body))
.size(12.0)
.width(Length::Fill)
)
] ]
) )
.width(Length::Fill), .width(Length::Fill),