diff --git a/src/app/about.rs b/src/app/about.rs index b234b84f..3796e948 100644 --- a/src/app/about.rs +++ b/src/app/about.rs @@ -10,18 +10,22 @@ pub struct About { /// The application's icon name. pub application_icon: Option, /// Artists who contributed to the application. + #[setters(skip)] pub artists: BTreeMap, /// Comments about the application. pub comments: Option, /// The application's copyright. pub copyright: Option, /// Designers who contributed to the application. + #[setters(skip)] pub designers: BTreeMap, /// Name of the application's developer. pub developer_name: Option, /// Developers who contributed to the application. + #[setters(skip)] pub developers: BTreeMap, /// Documenters who contributed to the application. + #[setters(skip)] pub documenters: BTreeMap, /// The license text. pub license: Option, @@ -32,9 +36,57 @@ pub struct About { /// The URL of the application’s repository. pub repository_url: Option, /// Translators who contributed to the application. + #[setters(skip)] pub translators: BTreeMap, /// The application’s version. pub version: Option, /// The application’s website. pub website: Option, } + +impl About { + pub fn set_artists(mut self, artists: impl Into>) -> Self { + let artists: BTreeMap = artists.into(); + self.artists = artists + .into_iter() + .map(|(k, v)| (k, format!("mailto:{v}"))) + .collect(); + self + } + + pub fn set_designers(mut self, designers: impl Into>) -> Self { + let designers: BTreeMap = designers.into(); + self.designers = designers + .into_iter() + .map(|(k, v)| (k, format!("mailto:{v}"))) + .collect(); + self + } + + pub fn set_developers(mut self, developers: impl Into>) -> Self { + let developers: BTreeMap = developers.into(); + self.developers = developers + .into_iter() + .map(|(k, v)| (k, format!("mailto:{v}"))) + .collect(); + self + } + + pub fn set_documenters(mut self, documenters: impl Into>) -> Self { + let documenters: BTreeMap = documenters.into(); + self.documenters = documenters + .into_iter() + .map(|(k, v)| (k, format!("mailto:{v}"))) + .collect(); + self + } + + pub fn set_translators(mut self, translators: impl Into>) -> Self { + let translators: BTreeMap = translators.into(); + self.translators = translators + .into_iter() + .map(|(k, v)| (k, format!("mailto:{v}"))) + .collect(); + self + } +} diff --git a/src/app/mod.rs b/src/app/mod.rs index 454fd1ad..7efdef92 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -620,7 +620,7 @@ where } else { let developers: Vec> = list .into_iter() - .map(|(name, email)| { + .map(|(name, url)| { widget::button::custom( widget::row() .push(widget::text(name)) @@ -630,9 +630,7 @@ where .align_y(Vertical::Center), ) .class(crate::theme::Button::Text) - .on_press(crate::app::cosmic::Message::OpenUrl(format!( - "mailto:{email}" - ))) + .on_press(crate::app::cosmic::Message::OpenUrl(url)) .width(Length::Fill) .into() })