Avatar


Object Hierarchy:

Adw.Avatar Adw.Avatar Adw.Avatar Gtk.Widget Gtk.Widget Gtk.Widget->Adw.Avatar GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Adw.Avatar Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Adw.Avatar Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Adw.Avatar Gtk.ConstraintTarget->Gtk.Widget

Description:

[ CCode ( type_id = "adw_avatar_get_type ()" ) ]
public sealed class Avatar : Widget, Accessible, Buildable, ConstraintTarget

A widget displaying an image, with a generated fallback.

<picture> <source srcset="avatar-dark.png" media="(prefers-color-scheme: dark)"> <img src="avatar.png" alt="avatar"> < /picture>

`AdwAvatar` is a widget that shows a round avatar.

`AdwAvatar` generates an avatar with the initials of the [property@Avatar:text] on top of a colored background.

The color is picked based on the hash of the [property@Avatar:text].

If [property@Avatar:show-initials] is set to `FALSE`, [property@Avatar:icon-name] or `avatar-default-symbolic` is shown instead of the initials.

Use [property@Avatar:custom-image] to set a custom image.

CSS nodes

`AdwAvatar` has a single CSS node with name `avatar`.


Namespace: Adw
Package: libadwaita-1

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget