Avatar

class Avatar(pointer: <Error class: unknown class><<Error class: unknown class>>)

A widget displaying an image, with a generated fallback.

avatar

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.

Constructors

Link copied to clipboard
constructor(size: Int, text: String? = null, showInitials: Boolean)

Creates a new AdwAvatar.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val adwAvatarPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
var customImage: <Error class: unknown class>?

A custom image paintable.

Link copied to clipboard
open val gtkAccessiblePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkConstraintTargetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

The name of an icon to use as a fallback.

Link copied to clipboard

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

Link copied to clipboard
var size: Int

The size of the avatar.

Link copied to clipboard
var text: String?

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

Functions

Link copied to clipboard
fun drawToTexture(scaleFactor: Int): <Error class: unknown class>

Renders @self into a class@Gdk.Texture at @scale_factor.

Link copied to clipboard
fun getCustomImage(): <Error class: unknown class>?

Gets the custom image paintable.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
fun getSize_(): Int

Gets the size of the avatar.

Link copied to clipboard
fun getText(): String?

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

Link copied to clipboard
fun setCustomImage(customImage: <Error class: unknown class>? = null)

Sets the custom image paintable.

Link copied to clipboard
fun setIconName(iconName: String? = null)

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

Link copied to clipboard
fun setShowInitials(showInitials: Boolean)

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

Link copied to clipboard
fun setSize(size: Int)

Sets the size of the avatar.

Link copied to clipboard
fun setText(text: String? = null)

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