-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to About #697
Conversation
Some tests are failing with an unresolved import for |
Sorry, should be fixed. |
some nitpicks:
wdyt @edfloreshz ? |
Those are great suggestions, I'll make the changes in the next couple of hours. |
here are some ideas of urls we can add https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines/#url |
This is what it looks like now: About::default()
.name("About Demo")
.icon(Self::APP_ID)
.version("0.1.0")
.author("System 76")
.license("GPL-3.0-only")
.developers([("Michael Murphy", "mmstick@system76.com")])
.links([
("Website", "https://system76.com/cosmic"),
("Repository", "https://github.com/pop-os/libcosmic)"),
("Support", "https://github.com/pop-os/libcosmic/issues"),
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new api!
Just some minor doc issues
Could you add this method to support the pub fn link(mut self, name: impl Into<String>, link: &'a str) -> Self {
self.links.insert(name.into(), link.to_string());
self
} Edit: or smtg like this |
I'm thinking of the best way to support localization with the existing set of methods. |
smtg like that could work: pub fn links<const N: usize>(
mut self,
links: [(impl Into<String>, impl Into<String>); N],
) -> Self {
self.links = links
.into_iter()
.map(|(k, v)| (k.into(), v.into()))
.collect();
self
} |
Decided to do this instead given that URLs don't really require localization, only labels. pub fn links<T: Into<String>>(mut self, links: impl Into<Vec<(T, &'a str)>>) -> Self {
let links: Vec<(T, &'a str)> = links.into();
self.links = links
.into_iter()
.map(|(k, v)| (k.into(), v.to_string()))
.collect();
self
} @wiiznokes Let me know if this works for you. |
Yeah we could give it some right padding |
@wiiznokes Please confirm if I can ask Michael to review. |
Is there a reason that the scrollable was removed from the drawer? Since now it isn't possible to make the scrollbar be at the right edge (to match designs), and that spacing that's required to make the scrollbar not cover content makes things off-center. |
Yeah, go ahead |
@mmstick This should be ready for review now. |
If #698 gets merged, the scrollbar spacing can be removed, but |
This PR makes several improvements to the about section.
links
public, letting anyone pass an array of label/link pairs.license
crate to handle licenses.license_type
and replaced it with a link to the license page (https://spdx.org/licenses).Closes #696