Adw.Avatar
Description: Reference for Adw.Avatar

### Class

# AdwAvatar

#### Description [src]

    final class Adw.Avatar : Gtk.Widget {
      /* No available fields */
    }

A widget displaying an image, with a generated fallback.

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

`AdwAvatar` generates an avatar with the initials of the `AdwAvatar:text` on top of a colored background.

The color is picked based on the hash of the `AdwAvatar:text`.

If `AdwAvatar:show-initials` is set to `FALSE`, `AdwAvatar:icon-name` or `avatar-default-symbolic` is shown instead of the initials.

Use `AdwAvatar:custom-image` to set a custom image.

## CSS nodes

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

Available since: | 1.0

#### Hierarchy

#### Ancestors

- GtkWidget
- GInitiallyUnowned
- GObject

#### Implements

- GtkAccessible
- GtkBuildable
- GtkConstraintTarget

#### Constructors

###### adw_avatar_new

Creates a new `AdwAvatar`.

Available since: 1.0

#### Instance methods

###### adw_avatar_draw_to_pixbuf

Renders `self` into a `GdkPixbuf` at `size` and `scale_factor`.

Available since: 1.0

###### adw_avatar_get_custom_image

Gets the custom image paintable.

Available since: 1.0

###### adw_avatar_get_icon_name

Gets the name of an icon to use as a fallback.

Available since: 1.0

###### adw_avatar_get_show_initials

Gets whether initials are used instead of an icon on the fallback avatar.

Available since: 1.0

###### adw_avatar_get_size

Gets the size of the avatar.

Available since: 1.0

###### adw_avatar_get_text

Gets the text used to generate the fallback initials and color.

Available since: 1.0

###### adw_avatar_set_custom_image

Sets the custom image paintable.

Available since: 1.0

###### adw_avatar_set_icon_name

Sets the name of an icon to use as a fallback.

Available since: 1.0

###### adw_avatar_set_show_initials

Sets whether to use initials instead of an icon on the fallback avatar.

Available since: 1.0

###### adw_avatar_set_size

Sets the size of the avatar.

Available since: 1.0

###### adw_avatar_set_text

Sets the text used to generate the fallback initials and color.

Available since: 1.0

#### Properties

###### Adw.Avatar:custom-image

A custom image to use instead of initials or icon.

Available since: 1.0

###### Adw.Avatar:icon-name

The name of an icon to use as a fallback.

Available since: 1.0

###### Adw.Avatar:show-initials

Whether initials are used instead of an icon on the fallback avatar.

Available since: 1.0

###### Adw.Avatar:size

The size of the avatar.

Available since: 1.0

###### Adw.Avatar:text

Sets the text used to generate the fallback initials and color.

Available since: 1.0

#### Class structure

    struct AdwAvatarClass {
      GtkWidgetClass parent_class;

    }

###### Class members

`parent_class` |
    GtkWidgetClass
| No description available.