diff options
author | 2024-07-21 13:12:38 +0200 | |
---|---|---|
committer | 2024-07-21 13:12:38 +0200 | |
commit | 7072c696a0a6d2a20e4cf5b44952360e15855d5a (patch) | |
tree | 58c0db5628cbfaca7318ffb0fbdd9122c04e79b6 /widget/src/markdown.rs | |
parent | 54500e61ed0ff2309f06dd5b441f9f5b627e05c9 (diff) | |
download | iced-7072c696a0a6d2a20e4cf5b44952360e15855d5a.tar.gz iced-7072c696a0a6d2a20e4cf5b44952360e15855d5a.tar.bz2 iced-7072c696a0a6d2a20e4cf5b44952360e15855d5a.zip |
Rename `on_link_click` to `on_link`
Diffstat (limited to 'widget/src/markdown.rs')
-rw-r--r-- | widget/src/markdown.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/widget/src/markdown.rs b/widget/src/markdown.rs index dc207a34..ae4020bc 100644 --- a/widget/src/markdown.rs +++ b/widget/src/markdown.rs @@ -278,7 +278,7 @@ pub fn parse( /// You can obtain the items with [`parse`]. pub fn view<'a, Message, Renderer>( items: impl IntoIterator<Item = &'a Item>, - on_link_click: impl Fn(String) -> Message + Copy + 'a, + on_link: impl Fn(String) -> Message + Copy + 'a, ) -> Element<'a, Message, Theme, Renderer> where Message: 'a, @@ -286,16 +286,16 @@ where { let blocks = items.into_iter().enumerate().map(|(i, item)| match item { Item::Heading(heading) => { - container(rich_text(heading).on_link_click(on_link_click)) + container(rich_text(heading).on_link(on_link)) .padding(padding::top(if i > 0 { 8 } else { 0 })) .into() } Item::Paragraph(paragraph) => { - rich_text(paragraph).on_link_click(on_link_click).into() + rich_text(paragraph).on_link(on_link).into() } Item::List { start: None, items } => { column(items.iter().map(|items| { - row!["•", view(items, on_link_click)].spacing(10).into() + row!["•", view(items, on_link)].spacing(10).into() })) .spacing(10) .into() @@ -304,7 +304,7 @@ where start: Some(start), items, } => column(items.iter().enumerate().map(|(i, items)| { - row![text!("{}.", i as u64 + *start), view(items, on_link_click)] + row![text!("{}.", i as u64 + *start), view(items, on_link)] .spacing(10) .into() })) @@ -314,7 +314,7 @@ where rich_text(code) .font(Font::MONOSPACE) .size(12) - .on_link_click(on_link_click), + .on_link(on_link), ) .width(Length::Fill) .padding(10) |