Skip to content

Granite.Avatar #940

@danirabbit

Description

@danirabbit

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DesignWaiting for input from the UX teamPriority: WishlistNot a bug; but a new feature or enhancement

    Projects

    Status

    Needs Discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions