Class: Handy::Avatar
- Inherits:
-
Gtk::DrawingArea
- Object
- Gtk::DrawingArea
- Handy::Avatar
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#draw_to_pixbuf(size, scale_factor) ⇒ GdkPixbuf::Pixbuf
Renders self into a [classGdkPixbuf.Pixbuf] at size and scale_factor.
-
#draw_to_pixbuf_async(size, scale_factor, cancellable, callback, user_data) ⇒ nil
Renders asynchronously self into a pixbuf at size and scale_factor.
-
#draw_to_pixbuf_finish(async_result) ⇒ GdkPixbuf::Pixbuf
Finishes an asynchronous draw of an avatar to a pixbuf.
-
#icon_name ⇒ String
The name of an icon to use as a fallback.
-
#icon_name=(icon_name) ⇒ String
The name of an icon to use as a fallback.
-
#initialize(size, text, show_initials) ⇒ Gtk::Widget
constructor
Creates a new
HdyAvatar. -
#loadable_icon ⇒ Gio::LoadableIcon
A [ifaceGio.LoadableIcon] used to load the avatar.
-
#loadable_icon=(loadable_icon) ⇒ Gio::LoadableIcon
A [ifaceGio.LoadableIcon] used to load the avatar.
-
#set_image_load_func(load_image, user_data, destroy) ⇒ nil
A callback which is called when the custom image needs to be reloaded.
-
#show_initials ⇒ Boolean
Gets whether initials are used instead of an icon on the fallback avatar.
-
#show_initials=(show_initials) ⇒ Boolean
Whether to show the initials or the fallback icon on the generated avatar.
-
#show_initials? ⇒ Boolean
Whether to show the initials or the fallback icon on the generated avatar.
-
#size ⇒ Integer
The avatar size of the avatar.
-
#size=(size) ⇒ Integer
The avatar size of the avatar.
-
#text ⇒ String
Sets the text used to generate the fallback initials and color.
-
#text=(text) ⇒ String
Sets the text used to generate the fallback initials and color.
Constructor Details
#initialize(size, text, show_initials) ⇒ Gtk::Widget
Creates a new HdyAvatar.
Instance Method Details
#draw_to_pixbuf(size, scale_factor) ⇒ GdkPixbuf::Pixbuf
Renders self into a [classGdkPixbuf.Pixbuf] at size and scale_factor.
This can be used to export the fallback avatar.
#draw_to_pixbuf_async(size, scale_factor, cancellable, callback, user_data) ⇒ nil
Renders asynchronously self into a pixbuf at size and scale_factor.
This can be used to export the fallback avatar.
#draw_to_pixbuf_finish(async_result) ⇒ GdkPixbuf::Pixbuf
Finishes an asynchronous draw of an avatar to a pixbuf.
#icon_name ⇒ String
The name of an icon to use as a fallback.
If no name is set, the avatar-default-symbolic icon will be used. If the name doesn't match a valid icon, it is an error and no icon will be displayed. If the icon theme is changed, the image will be updated automatically.
#icon_name=(icon_name) ⇒ String
The name of an icon to use as a fallback.
If no name is set, the avatar-default-symbolic icon will be used. If the name doesn't match a valid icon, it is an error and no icon will be displayed. If the icon theme is changed, the image will be updated automatically.
#loadable_icon ⇒ Gio::LoadableIcon
A [ifaceGio.LoadableIcon] used to load the avatar.
#loadable_icon=(loadable_icon) ⇒ Gio::LoadableIcon
A [ifaceGio.LoadableIcon] used to load the avatar.
#set_image_load_func(load_image, user_data, destroy) ⇒ nil
A callback which is called when the custom image needs to be reloaded.
It will be called on [propertyAvatar:size] or [propertyGtk.Widget:scale-factor] changes.
#show_initials ⇒ Boolean
Gets whether initials are used instead of an icon on the fallback avatar.
#show_initials=(show_initials) ⇒ Boolean
Whether to show the initials or the fallback icon on the generated avatar.
#show_initials? ⇒ Boolean
Whether to show the initials or the fallback icon on the generated avatar.
#size ⇒ Integer
The avatar size of the avatar.
#size=(size) ⇒ Integer
The avatar size of the avatar.
#text ⇒ String
Sets the text used to generate the fallback initials and color.
It's only used to generate the color if [propertyAvatar:show-initials] is
FALSE.
#text=(text) ⇒ String
Sets the text used to generate the fallback initials and color.
It's only used to generate the color if [propertyAvatar:show-initials] is
FALSE.