adw.avatar
Module for [Avatar] class
Types 3
classAvatar : gtk.widget.Widget
A widget displaying an image, with a generated fallback.
[adw.avatar.Avatar] is a widget that shows a round avatar.
[adw.avatar.Avatar] 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
[adw.avatar.Avatar] has a single CSS node with name avatar.
Methods
AvatarGidBuilder builder()Get builder for [adw.avatar.Avatar] Returns: New builder objectgdk.paintable.Paintable customImage() @propertyGet `customImage` property. Returns: A custom image paintable.void customImage(gdk.paintable.Paintable propval) @propertySet `customImage` property. Params: propval = A custom image paintable.string iconName() @propertyGet `iconName` property. Returns: The name of an icon to use as a fallback.void iconName(string propval) @propertySet `iconName` property. Params: propval = The name of an icon to use as a fallback.bool showInitials() @propertyGet `showInitials` property. Returns: Whether initials are used instead of an icon on the fallback avatar.void showInitials(bool propval) @propertySet `showInitials` property. Params: propval = Whether initials are used instead of an icon on the fallback avatar.string text() @propertyGet `text` property. Returns: Sets the text used to generate the fallback initials and color.void text(string propval) @propertySet `text` property. Params: propval = Sets the text used to generate the fallback initials and color.gdk.texture.Texture drawToTexture(int scaleFactor)Renders self into a [gdk.texture.Texture] at scale_factor.gdk.paintable.Paintable getCustomImage()Gets the custom image paintable. Returns: the custom imagestring getIconName()Gets the name of an icon to use as a fallback. Returns: the icon namebool getShowInitials()Gets whether initials are used instead of an icon on the fallback avatar. Returns: whether initials are used instead of an icon as fallbackint getSize()Gets the size of the avatar. Returns: the size of the avatarstring getText()Gets the text used to generate the fallback initials and color. Returns: the text used to generate the fallback initials and colorvoid setCustomImage(gdk.paintable.Paintable customImage = null)Sets the custom image paintable.void setIconName(string iconName = null)Sets the name of an icon to use as a fallback.void setShowInitials(bool showInitials)Sets whether to use initials instead of an icon on the fallback avatar.void setSize(int size)Sets the size of the avatar.void setText(string text = null)Sets the text used to generate the fallback initials and color.classAvatarGidBuilderImpl(T) : gtk.widget.WidgetGidBuilderImpl!T
Methods
T customImage(gdk.paintable.Paintable propval)Set `customImage` property. Params: propval = A custom image paintable.T iconName(string propval)Set `iconName` property. Params: propval = The name of an icon to use as a fallback.T showInitials(bool propval)Set `showInitials` property. Params: propval = Whether initials are used instead of an icon on the fallback avatar.T size(int propval)Set `size` property. Params: propval = The size of the avatar. Returns: Builder instance for fluent chainingT text(string propval)Set `text` property. Params: propval = Sets the text used to generate the fallback initials and color.