[giggle] giggle-avatar-image: Replace size_request by get_preferred_width/height



commit e7b199890d3d376b9d17eeb73807020b88994540
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Nov 17 17:25:00 2010 +0100

    giggle-avatar-image: Replace size_request by get_preferred_width/height

 src/giggle-avatar-image.c |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/src/giggle-avatar-image.c b/src/giggle-avatar-image.c
index d37493e..262f36c 100644
--- a/src/giggle-avatar-image.c
+++ b/src/giggle-avatar-image.c
@@ -393,6 +393,32 @@ avatar_image_size_request (GtkWidget      *widget,
 }
 
 static void
+avatar_image_get_preferred_width (GtkWidget *widget,
+                                  gint      *minimum,
+                                  gint      *natural)
+{
+	GiggleAvatarImagePriv *priv = GET_PRIV (widget);
+	GtkRequisition requisition;
+
+	avatar_image_size_request (widget, &requisition);
+
+	*minimum = *natural = requisition.width;
+}
+
+static void
+avatar_image_get_preferred_height (GtkWidget *widget,
+                                   gint      *minimum,
+                                   gint      *natural)
+{
+	GiggleAvatarImagePriv *priv = GET_PRIV (widget);
+	GtkRequisition requisition;
+
+	avatar_image_size_request (widget, &requisition);
+
+	*minimum = *natural = requisition.height;
+}
+
+static void
 giggle_avatar_image_class_init (GiggleAvatarImageClass *class)
 {
 	GObjectClass   *object_class = G_OBJECT_CLASS (class);
@@ -403,7 +429,8 @@ giggle_avatar_image_class_init (GiggleAvatarImageClass *class)
 	object_class->finalize     = avatar_image_finalize;
 
 	widget_class->draw = avatar_image_draw;
-	widget_class->size_request = avatar_image_size_request;
+	widget_class->get_preferred_width = avatar_image_get_preferred_width;
+	widget_class->get_preferred_height = avatar_image_get_preferred_height;
 
 	g_object_class_install_property
 		(object_class, PROP_CACHE,



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