summaryrefslogtreecommitdiffstats
path: root/widget/src/text/rich.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-21 20:00:02 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-21 20:00:02 +0200
commit65b525af7ff2823cfe635c4b26d33aad9068e392 (patch)
treedbd792192e3cdc90a46c822b73287c1828380eeb /widget/src/text/rich.rs
parentf830454ffad1cf60f1d6e56fe95514af96848a64 (diff)
downloadiced-65b525af7ff2823cfe635c4b26d33aad9068e392.tar.gz
iced-65b525af7ff2823cfe635c4b26d33aad9068e392.tar.bz2
iced-65b525af7ff2823cfe635c4b26d33aad9068e392.zip
Introduce `markdown::Settings`
Diffstat (limited to 'widget/src/text/rich.rs')
-rw-r--r--widget/src/text/rich.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/widget/src/text/rich.rs b/widget/src/text/rich.rs
index 625ea089..05ad6576 100644
--- a/widget/src/text/rich.rs
+++ b/widget/src/text/rich.rs
@@ -161,6 +161,15 @@ where
self
}
+ /// Sets the message handler for link clicks on the [`Rich`] text.
+ pub fn on_link_maybe(
+ mut self,
+ on_link: Option<impl Fn(Link) -> Message + 'a>,
+ ) -> Self {
+ self.on_link = on_link.map(|on_link| Box::new(on_link) as _);
+ self
+ }
+
/// Sets the default style class of the [`Rich`] text.
#[cfg(feature = "advanced")]
#[must_use]