[libhandy] avatar: Remove usage example



commit 863d4fdc97c031b37c5a4523accb0671997492c0
Author: Julian Sparber <julian sparber net>
Date:   Mon Jan 11 15:42:07 2021 +0100

    avatar: Remove usage example
    
    The example uses the deprecated function to load the avatar and loading
    a custom avatar via the GLoadableIcon is much simpler.

 src/hdy-avatar.c | 30 ++----------------------------
 1 file changed, 2 insertions(+), 28 deletions(-)
---
diff --git a/src/hdy-avatar.c b/src/hdy-avatar.c
index 75166278..9c2476e0 100644
--- a/src/hdy-avatar.c
+++ b/src/hdy-avatar.c
@@ -32,34 +32,8 @@
  * The color is picked based on the hash of the #HdyAvatar:text.
  * If #HdyAvatar:show-initials is set to %FALSE, `avatar-default-symbolic` is
  * shown in place of the initials.
- * Use hdy_avatar_set_image_load_func () to set a custom image.
- * Create a #HdyAvatarImageLoadFunc similar to this example:
- *
- * |[<!-- language="C" -->
- * static GdkPixbuf *
- * image_load_func (gint size, gpointer user_data)
- * {
- *   g_autoptr (GError) error = NULL;
- *   g_autoptr (GdkPixbuf) pixbuf = NULL;
- *   g_autofree gchar *file = gtk_file_chooser_get_filename ("avatar.png");
- *   gint width, height;
- *
- *   gdk_pixbuf_get_file_info (file, &width, &height);
- *
- *   pixbuf = gdk_pixbuf_new_from_file_at_scale (file,
- *                                              (width <= height) ? size : -1,
- *                                              (width >= height) ? size : -1,
- *                                              TRUE,
- *                                              error);
- *   if (error != NULL) {
- *    g_critical ("Failed to create pixbuf from file: %s", error->message);
- *
- *    return NULL;
- *   }
- *
- *   return pixbuf;
- * }
- * ]|
+ * Use hdy_avatar_set_loadable_icon() or #HdyAvatar:loadable-icon to set a
+ * custom image.
  *
  * # CSS nodes
  *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]