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 adw.avatar.Avatar.text on top of a colored background.
The color is picked based on the hash of the adw.avatar.Avatar.text.
If adw.avatar.Avatar.showInitials is set to FALSE, adw.avatar.Avatar.iconName or avatar-default-symbolic is shown instead of the initials.
Use adw.avatar.Avatar.customImage to set a custom image.
CSS nodes
adw.avatar.Avatar has a single CSS node with name avatar.
Methods
AvatarGidBuilder builder() static nothrowGet builder for [adw.avatar.Avatar] Returns: New builder objectgdk.paintable.Paintable customImage() @property nothrowGet `customImage` property. Returns: A custom image paintable.void customImage(gdk.paintable.Paintable propval) @property nothrowSet `customImage` property. Params: propval = A custom image paintable.string iconName() @property nothrowGet `iconName` property. Returns: The name of an icon to use as a fallback.void iconName(string propval) @property nothrowSet `iconName` property. Params: propval = The name of an icon to use as a fallback.bool showInitials() @property nothrowGet `showInitials` property. Returns: Whether initials are used instead of an icon on the fallback avatar.void showInitials(bool propval) @property nothrowSet `showInitials` property. Params: propval = Whether initials are used instead of an icon on the fallback avatar.void size(int propval) @property nothrowSet `size` property. Params: propval = The size of the avatar.string text() @property nothrowGet `text` property. Returns: Sets the text used to generate the fallback initials and color.void text(string propval) @property nothrowSet `text` property. Params: propval = Sets the text used to generate the fallback initials and color.gdk.texture.Texture drawToTexture(int scaleFactor) nothrowRenders self into a [gdk.texture.Texture] at scale_factor.gdk.paintable.Paintable getCustomImage() nothrowGets the custom image paintable. Returns: the custom imagebool getShowInitials() nothrowGets whether initials are used instead of an icon on the fallback avatar. Returns: whether initials are used instead of an icon as fallbackstring getText() nothrowGets 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) nothrowSets the custom image paintable.void setShowInitials(bool showInitials) nothrowSets whether to use initials instead of an icon on the fallback avatar.void setText(string text = null) nothrowSets the text used to generate the fallback initials and color.classAvatarGidBuilderImpl(T) : gtk.widget.WidgetGidBuilderImpl!T
Fluent builder implementation template for adw.avatar.Avatar
Methods
T customImage(gdk.paintable.Paintable propval) nothrowSet `customImage` property. Params: propval = A custom image paintable.T iconName(string propval) nothrowSet `iconName` property. Params: propval = The name of an icon to use as a fallback.T showInitials(bool propval) nothrowSet `showInitials` property. Params: propval = Whether initials are used instead of an icon on the fallback avatar.T size(int propval) nothrowSet `size` property. Params: propval = The size of the avatar. Returns: Builder instance for fluent chainingT text(string propval) nothrowSet `text` property. Params: propval = Sets the text used to generate the fallback initials and color.Fluent builder for adw.avatar.Avatar