Avatar
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
- Constructors:
Avatar(**properties)
new(size:int, text:str=None, show_initials:bool) -> Gtk.Widget
Constructors
Methods
- class Avatar
- draw_to_texture(scale_factor: int) Texture
Renders
self
into aTexture
atscale_factor
.This can be used to export the fallback avatar.
- Parameters:
scale_factor – The scale factor
- get_show_initials() bool
Gets whether initials are used instead of an icon on the fallback avatar.
- set_custom_image(custom_image: Paintable | None = None) None
Sets the custom image paintable.
Custom image is displayed instead of initials or icon.
- Parameters:
custom_image – a custom image
- set_icon_name(icon_name: str | None = None) None
Sets the name of an icon to use as a fallback.
If no name is set,
avatar-default-symbolic
will be used.- Parameters:
icon_name – the icon name
- set_show_initials(show_initials: bool) None
Sets whether to use initials instead of an icon on the fallback avatar.
See
icon_name
for how to change the fallback icon.- Parameters:
show_initials – whether to use initials instead of an icon as fallback
- set_text(text: str | None = None) None
Sets the text used to generate the fallback initials and color.
It’s only used to generate the color if
show_initials
isFALSE
.- Parameters:
text – the text used to get the initials and color
Properties
- class Avatar
- props.custom_image: Paintable
A custom image paintable.
Custom image is displayed instead of initials or icon.
- props.icon_name: str
The name of an icon to use as a fallback.
If no name is set,
avatar-default-symbolic
will be used.
- props.show_initials: bool
Whether initials are used instead of an icon on the fallback avatar.
See
icon_name
for how to change the fallback icon.
- props.text: str
Sets the text used to generate the fallback initials and color.
It’s only used to generate the color if
show_initials
isFALSE
.