Class
Adw.Avatar
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.
Constructors
adw_avatar_new
Creates a new AdwAvatar.
Instance methods
adw_avatar_draw_to_pixbuf
Renders self into a GdkPixbuf at size and scale_factor.
adw_avatar_get_custom_image
Gets the custom image paintable.
adw_avatar_get_icon_name
Gets the name of an icon to use as a fallback.
adw_avatar_get_show_initials
Gets whether initials are used instead of an icon on the fallback avatar.
adw_avatar_get_size
Gets the size of the avatar.
adw_avatar_get_text
Gets the text used to generate the fallback initials and color.
adw_avatar_set_custom_image
Sets the custom image paintable.
adw_avatar_set_icon_name
Sets the name of an icon to use as a fallback.
adw_avatar_set_show_initials
Sets whether to use initials instead of an icon on the fallback avatar.
adw_avatar_set_size
Sets the size of the avatar.
adw_avatar_set_text
Sets the text used to generate the fallback initials and color.
Properties
Adw.Avatar:custom-image
A custom image to use instead of initials or icon.
Adw.Avatar:icon-name
The name of an icon to use as a fallback.
Adw.Avatar:show-initials
Whether initials are used instead of an icon on the fallback avatar.
Adw.Avatar:size
The size of the avatar.
Adw.Avatar:text
Sets the text used to generate the fallback initials and color.