summaryrefslogtreecommitdiffstats
path: root/examples/changelog
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-04 07:53:56 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-04 07:53:56 +0100
commit565599876172b3f56d86b119ae453b5bcd8949e1 (patch)
tree5353cb71aa595fc5ef3445e104b4776b8cc61ccb /examples/changelog
parentc02ae0c4a430994247e6fbc4318ac344ab89123c (diff)
downloadiced-565599876172b3f56d86b119ae453b5bcd8949e1.tar.gz
iced-565599876172b3f56d86b119ae453b5bcd8949e1.tar.bz2
iced-565599876172b3f56d86b119ae453b5bcd8949e1.zip
Draft `Viewer` trait for `markdown`
Diffstat (limited to 'examples/changelog')
-rw-r--r--examples/changelog/src/main.rs26
1 files changed, 11 insertions, 15 deletions
diff --git a/examples/changelog/src/main.rs b/examples/changelog/src/main.rs
index f889e757..a6528ce9 100644
--- a/examples/changelog/src/main.rs
+++ b/examples/changelog/src/main.rs
@@ -267,25 +267,21 @@ impl Generator {
} => {
let details = {
let title = rich_text![
- span(&pull_request.title).size(24).link(
- Message::OpenPullRequest(pull_request.id)
- ),
+ span(&pull_request.title)
+ .size(24)
+ .link(pull_request.id),
span(format!(" by {}", pull_request.author))
.font(Font {
style: font::Style::Italic,
..Font::default()
}),
]
+ .on_link_clicked(Message::OpenPullRequest)
.font(Font::MONOSPACE);
- let description = markdown::view(
- description,
- markdown::Settings::default(),
- markdown::Style::from_palette(
- self.theme().palette(),
- ),
- )
- .map(Message::UrlClicked);
+ let description =
+ markdown::view(&self.theme(), description)
+ .map(Message::UrlClicked);
let labels =
row(pull_request.labels.iter().map(|label| {
@@ -349,11 +345,11 @@ impl Generator {
container(
scrollable(
markdown::view(
- preview,
- markdown::Settings::with_text_size(12),
- markdown::Style::from_palette(
- self.theme().palette(),
+ markdown::Settings::with_text_size(
+ 12,
+ &self.theme(),
),
+ preview,
)
.map(Message::UrlClicked),
)