[giggle/gtk3: 3/7] Use gtk_widget_get_preferred_size() instead gtk_widget_size_request()
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [giggle/gtk3: 3/7] Use gtk_widget_get_preferred_size() instead gtk_widget_size_request()
- Date: Wed, 27 Oct 2010 02:30:42 +0000 (UTC)
commit c78fb1485238bc9b5e4805ee89d33d2d444db966
Author: Javier Jardón <jjardon gnome org>
Date: Wed Oct 27 03:17:54 2010 +0200
Use gtk_widget_get_preferred_size() instead gtk_widget_size_request()
src/giggle-avatar-image.c | 2 +-
src/giggle-short-list.c | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/giggle-avatar-image.c b/src/giggle-avatar-image.c
index d11a273..310e3b5 100644
--- a/src/giggle-avatar-image.c
+++ b/src/giggle-avatar-image.c
@@ -346,7 +346,7 @@ avatar_image_expose_event (GtkWidget *widget,
int w, h;
cairo_t *cr;
- gtk_widget_size_request (widget, &requisition);
+ gtk_widget_get_preferred_size (widget, &requisition, NULL);
gtk_widget_get_allocation (widget, &allocation);
style = gtk_widget_get_style (widget);
diff --git a/src/giggle-short-list.c b/src/giggle-short-list.c
index d876f53..704cad5 100644
--- a/src/giggle-short-list.c
+++ b/src/giggle-short-list.c
@@ -120,12 +120,12 @@ short_list_size_request (GtkWidget *widget,
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
spacing = gtk_box_get_spacing (GTK_BOX (widget));
- gtk_widget_size_request (priv->label, &req);
+ gtk_widget_get_preferred_size (priv->label, &req, NULL);
*requisition = req;
- gtk_widget_size_request (priv->content_box, &req);
+ gtk_widget_get_preferred_size (priv->content_box, &req, NULL);
+ gtk_widget_get_preferred_size (priv->more_button, &req, NULL);
- gtk_widget_size_request (priv->more_button, &req);
requisition->width = MAX (requisition->width, req.width) + (2 * border_width);
requisition->height += req.width + spacing + (2 * border_width);
}
@@ -164,7 +164,7 @@ short_list_size_allocate (GtkWidget *widget,
child_allocation.width = allocation->width;
/* allocate label */
- gtk_widget_size_request (priv->label, &label_requisition);
+ gtk_widget_get_preferred_size (priv->label, &label_requisition, NULL);
child_allocation.y = allocation->y;
child_allocation.height = label_requisition.height;
@@ -176,7 +176,7 @@ short_list_size_allocate (GtkWidget *widget,
children = list = gtk_container_get_children (GTK_CONTAINER (priv->content_box));
while (list) {
- gtk_widget_size_request (list->data, &data_requisition);
+ gtk_widget_get_preferred_size (list->data, &data_requisition, NULL);
content_height += data_requisition.height;
list = list->next;
@@ -185,7 +185,7 @@ short_list_size_allocate (GtkWidget *widget,
if (content_height > allocation->height) {
GtkRequisition button_requisition;
- gtk_widget_size_request (priv->more_button, &button_requisition);
+ gtk_widget_get_preferred_size (priv->more_button, &button_requisition, NULL);
/* just show the elements that fit in the allocation */
child_allocation.y = allocation->y;
@@ -199,7 +199,7 @@ short_list_size_allocate (GtkWidget *widget,
content_height = child_allocation.height;
while (list) {
- gtk_widget_size_request (list->data, &data_requisition);
+ gtk_widget_get_preferred_size (list->data, &data_requisition, NULL);
if (content_height > data_requisition.height) {
gtk_widget_set_child_visible (GTK_WIDGET (list->data), TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]