diff --git a/src/app/mod.rs b/src/app/mod.rs index c9daef02..c0e2f04d 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -48,6 +48,7 @@ pub mod message { } use std::borrow::Cow; +use std::collections::BTreeMap; pub use self::command::Task; pub use self::core::Core; @@ -58,9 +59,11 @@ use crate::widget::{ }; use crate::{prelude::*, widget}; use apply::Apply; +use iced::alignment::Vertical; use iced::{window, Alignment}; use iced::{Length, Subscription}; pub use message::Message; +use taffy::AlignContent; use url::Url; #[cfg(feature = "single-instance")] use { @@ -610,7 +613,7 @@ where .application_icon .map(|icon| crate::desktop::IconSource::Name(icon).as_cosmic_icon()); - let mut links: HashMap = HashMap::new(); + let mut links: BTreeMap = BTreeMap::new(); if let Some(website) = about.website { links.insert("Website".into(), website); @@ -645,7 +648,7 @@ where widget::row() .push_maybe(version) .push_maybe(license) - .spacing(spacing.space_xxs), + .spacing(spacing.space_xs), ) .push_maybe(links_section) .push_maybe(developers_section) @@ -656,7 +659,7 @@ where .push_maybe(comments) .push_maybe(copyright) .align_x(Alignment::Center) - .spacing(spacing.space_xxs) + .spacing(spacing.space_xs) .width(Length::Fill) .into() } else { @@ -666,26 +669,33 @@ where fn maintainer_section<'a>( &'a self, - list: HashMap, + list: BTreeMap, title: &'a str, ) -> Option> { + let spacing = crate::theme::active().cosmic().spacing; let developers_section = if list.is_empty() { None } else { let developers: Vec> = list .into_iter() .map(|(name, email)| { - widget::button::link(name) - .on_press(crate::app::cosmic::Message::OpenUrl(format!( - "mailto:{email}" - ))) - .into() + widget::button::custom( + widget::row() + .push(widget::text(name)) + .push(horizontal_space()) + .push(crate::widget::icon::from_name("link-symbolic").icon()) + .padding(spacing.space_xxs) + .align_y(Vertical::Center), + ) + .class(crate::theme::Button::Text) + .on_press(crate::app::cosmic::Message::OpenUrl(format!( + "mailto:{email}" + ))) + .width(Length::Fill) + .into() }) .collect(); - let mut developers_section = widget::settings::section().title(title); - for developer in developers { - developers_section = developers_section.add(developer); - } + let developers_section = widget::settings::section().title(title).extend(developers); Some(developers_section) }; developers_section diff --git a/src/widget/about.rs b/src/widget/about.rs index 4d870500..b234b84f 100644 --- a/src/widget/about.rs +++ b/src/widget/about.rs @@ -1,7 +1,5 @@ -use crate::{widget, Element}; - #[cfg(feature = "desktop")] -use std::collections::HashMap; +use std::collections::BTreeMap; #[cfg(feature = "desktop")] #[derive(Debug, Default, Clone, derive_setters::Setters)] @@ -12,19 +10,19 @@ pub struct About { /// The application's icon name. pub application_icon: Option, /// Artists who contributed to the application. - pub artists: HashMap, + pub artists: BTreeMap, /// Comments about the application. pub comments: Option, /// The application's copyright. pub copyright: Option, /// Designers who contributed to the application. - pub designers: HashMap, + pub designers: BTreeMap, /// Name of the application's developer. pub developer_name: Option, /// Developers who contributed to the application. - pub developers: HashMap, + pub developers: BTreeMap, /// Documenters who contributed to the application. - pub documenters: HashMap, + pub documenters: BTreeMap, /// The license text. pub license: Option, /// The license from a list of known licenses. @@ -34,7 +32,7 @@ pub struct About { /// The URL of the application’s repository. pub repository_url: Option, /// Translators who contributed to the application. - pub translators: HashMap, + pub translators: BTreeMap, /// The application’s version. pub version: Option, /// The application’s website.