elementary / elementary/granite

Granite.Avatar

Open
#940 0 comments 1 reaction 0 assignees View on GitHub
Needs Design Priority: Wishlist
Dominant language
Vala
Stars
329
Forks
65
Avg merge
1d 14h
Merged PRs (30d)
31

Description

### Problem

We pretty frequently need a widget that represents an avatar and we're currently relying on Adw for this, but in GTK4 it's really trivial now to clip paintables to a widget

### Proposal

Write our own avatar widget with:
- [ ] Set size. (Perhaps with Gtk.IconSize? We mostly use 32px and 48px)
- [ ] Set an image via paintable so it's a drop-in replacement
- [ ] Set text for generating fallback initials
- [ ] An icon to fallback to when there's no initials
- [ ] Colors (used in fallback) from our palette that are assigned based on a hash so they're consistent
- [ ] An option to make the fallback the user's chosen accent color. We want to do this when the avatar represents ourselves
- [ ] a `has_frame` property since we use a flat style in quick settings

### Prior Art (Optional)

https://valadoc.org/libadwaita-1/Adw.Avatar.html

https://github.com/search?q=org%3Aelementary%20Adw.Avatar&type=code

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.