From 53741bd1a119a2069fb36bef03d188ef6eaee383 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 13:08:36 -0500 Subject: [PATCH] Restore About link icon buttons --- crates/ui-egui/src/dialogs/about.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/dialogs/about.rs b/crates/ui-egui/src/dialogs/about.rs index ae60f3ce22..3655c17fd0 100644 --- a/crates/ui-egui/src/dialogs/about.rs +++ b/crates/ui-egui/src/dialogs/about.rs @@ -1,5 +1,6 @@ //! Help ▸ About: the framework's hosted About dialog over the app's info and the baked credits. +use craft::behavior::IconId; use craft::ui::patterns::form_dialogs::{AboutImage, AboutInfo, AboutLink, AboutTab, HostedAbout}; use crate::PdfCraftApp; @@ -13,7 +14,7 @@ const LOGO_WHITE: &[u8] = include_bytes!("../../../../docs/brand/artcraft-logo-w /// What the About tab shows: PdfCraft's name, blurb and version, the ArtCraft brand, and the community links. fn info() -> AboutInfo { - let mut info = AboutInfo::new( + let info = AboutInfo::new( "PdfCraft", tl!("A clean-room, open-source PDF application written in Rust. MIT OR Apache-2.0."), pdfcraft_engine::build_info::version(), @@ -21,12 +22,7 @@ fn info() -> AboutInfo { .mark(AboutImage::svg("ArtCraft", MARK)) .part_of(AboutImage::svg("ArtCraft", LOGO).dark(LOGO_WHITE)) .built_with("Rendering: hayro (bootstrap) · UI: egui · Icons: Lucide (ISC) · Fonts: Inter, JetBrains Mono, Dancing Script (OFL)"); - let (community, others): (Vec<&pdfcraft_engine::links::Link>, Vec<&pdfcraft_engine::links::Link>) = - pdfcraft_engine::links::LINKS.iter().partition(|l| l.url == pdfcraft_engine::links::DISCORD); - if let Some(l) = community.first() { - info = info.community(AboutLink::new(tl!(l.label).to_string(), l.url)); - } - info.links(others.into_iter().map(|l| AboutLink::new(tl!(l.label).to_string(), l.url))) + info.links(pdfcraft_engine::links::LINKS.iter().map(|l| AboutLink::new(tl!(l.label).to_string(), l.url).icon(IconId::new(l.icon)))) } impl PdfCraftApp { @@ -43,3 +39,16 @@ impl PdfCraftApp { self.open_url(&url); } } + +#[cfg(test)] +mod tests { + #[test] + fn about_community_links_keep_their_icons_and_destinations() { + let info = super::info(); + assert_eq!(info.links.len(), pdfcraft_engine::links::LINKS.len()); + for (shown, expected) in info.links.iter().zip(pdfcraft_engine::links::LINKS) { + assert_eq!(shown.url, expected.url); + assert_eq!(shown.icon, Some(craft::behavior::IconId::new(expected.icon))); + } + } +}