[evolution/gtk3: 25/47] Adapt size_request vfunc for gtk+-3.0 changes



commit 94ee199ce43135908d094e85458de25e6c10fef2
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Dec 13 16:35:27 2010 +0530

    Adapt size_request vfunc for gtk+-3.0 changes
    
    some misc. fixes for size_request

 libgnomecanvas/gailcanvas.c          |    4 +-
 mail/e-mail-attachment-bar.c         |   23 ++-----------
 shell/e-shell-content.c              |   54 +++++++++++++++++++++--------
 shell/e-shell-meego.c                |    2 +-
 shell/e-shell-sidebar.c              |   42 +++++++++++++++++------
 shell/e-shell-switcher.c             |   62 ++++++++++++++++++++++++++--------
 widgets/misc/e-attachment-button.c   |    2 +-
 widgets/misc/e-calendar.c            |   33 ++++++++++++------
 widgets/misc/e-cell-renderer-combo.c |    2 +-
 widgets/misc/e-combo-cell-editable.c |    2 +-
 widgets/misc/e-dateedit.c            |    8 ++--
 widgets/misc/e-map.c                 |   31 ++++++-----------
 widgets/table/e-cell-combo.c         |    2 +-
 widgets/table/e-cell-date-edit.c     |    2 +-
 widgets/table/e-table.c              |   22 ++++++++----
 15 files changed, 181 insertions(+), 110 deletions(-)
---
diff --git a/libgnomecanvas/gailcanvas.c b/libgnomecanvas/gailcanvas.c
index 88a42c0..881916a 100644
--- a/libgnomecanvas/gailcanvas.c
+++ b/libgnomecanvas/gailcanvas.c
@@ -179,13 +179,13 @@ gail_canvas_real_initialize (AtkObject *obj,
 
   canvas = GNOME_CANVAS (data);
 
-  adj = gtk_layout_get_hadjustment (GTK_LAYOUT (canvas));
+  adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
   g_signal_connect (adj,
                     "value_changed",
                     G_CALLBACK (adjustment_changed),
                     canvas);
 
-  adj = gtk_layout_get_vadjustment (GTK_LAYOUT (canvas));
+  adj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
   g_signal_connect (adj,
                     "value_changed",
                     G_CALLBACK (adjustment_changed),
diff --git a/mail/e-mail-attachment-bar.c b/mail/e-mail-attachment-bar.c
index 519eaf8..7ccc5c6 100644
--- a/mail/e-mail-attachment-bar.c
+++ b/mail/e-mail-attachment-bar.c
@@ -323,23 +323,10 @@ mail_attachment_bar_constructed (GObject *object)
 }
 
 static void
-mail_attachment_bar_size_request (GtkWidget *widget,
-                                  GtkRequisition *requisition)
+mail_attachment_bar_get_preferred_width (GtkWidget *widget,
+                                         gint      *minimum,
+                                         gint      *natural)
 {
-	/* XXX This works around GtkHTMLEmbedded not taking visibility
-	 *     into account when calculating its size (at least I think
-	 *     that's where it's broken).  Without the workaround, we
-	 *     get a sizable gap between the headers and body when this
-	 *     widget is invisible.  Once we finally move to WebKit,
-	 *     remove this. */
-	if (!gtk_widget_get_visible (widget)) {
-		requisition->width = 0;
-		requisition->height = 0;
-		return;
-	}
-
-	/* Chain up to parent's size_request() method. */
-	GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
 }
 
 static EAttachmentViewPrivate *
@@ -461,7 +448,6 @@ static void
 mail_attachment_bar_class_init (EMailAttachmentBarClass *class)
 {
 	GObjectClass *object_class;
-	GtkWidgetClass *widget_class;
 
 	parent_class = g_type_class_peek_parent (class);
 	g_type_class_add_private (class, sizeof (EMailAttachmentBarPrivate));
@@ -472,9 +458,6 @@ mail_attachment_bar_class_init (EMailAttachmentBarClass *class)
 	object_class->dispose = mail_attachment_bar_dispose;
 	object_class->constructed = mail_attachment_bar_constructed;
 
-	widget_class = GTK_WIDGET_CLASS (class);
-	widget_class->size_request = mail_attachment_bar_size_request;
-
 	g_object_class_install_property (
 		object_class,
 		PROP_ACTIVE_VIEW,
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c
index d9360df..4fd84e3 100644
--- a/shell/e-shell-content.c
+++ b/shell/e-shell-content.c
@@ -213,31 +213,54 @@ shell_content_constructed (GObject *object)
 }
 
 static void
-shell_content_size_request (GtkWidget *widget,
-                            GtkRequisition *requisition)
+shell_content_get_preferred_width (GtkWidget *widget,
+                                   gint      *minimum,
+                                   gint      *natural)
 {
 	EShellContentPrivate *priv;
-	GtkRequisition child_requisition;
+        gint min, nat;
+        gint child_min, child_nat;
 	GtkWidget *child;
 
 	priv = E_SHELL_CONTENT_GET_PRIVATE (widget);
 
-	requisition->width = 0;
-	requisition->height = 0;
+        *minimum = *natural = 0;
 
 	child = gtk_bin_get_child (GTK_BIN (widget));
-	gtk_widget_size_request (child, requisition);
+        gtk_widget_get_preferred_width (child, &child_min, &child_nat);
+        gtk_widget_get_preferred_width (priv->alert_bar, &min, &nat);
+
+        *minimum = MAX (min, child_min);
+        *natural = MAX (nat, child_nat);
+
+	if (priv->searchbar == NULL)
+		return;
+
+        gtk_widget_get_preferred_width (priv->searchbar, &min, &nat);
+        *minimum = MAX (*minimum, min);
+        *natural = MAX (*natural, nat);
+}
 
-	gtk_widget_size_request (priv->alert_bar, &child_requisition);
-	requisition->width = MAX (requisition->width, child_requisition.width);
-	requisition->height += child_requisition.height;
+static void
+shell_content_get_preferred_height (GtkWidget *widget,
+                                    gint      *minimum,
+                                    gint      *natural)
+{
+	EShellContentPrivate *priv;
+        gint min, nat;
+	GtkWidget *child;
+
+	priv = E_SHELL_CONTENT_GET_PRIVATE (widget);
+
+	child = gtk_bin_get_child (GTK_BIN (widget));
+	gtk_widget_get_preferred_height (child, minimum, natural);
 
 	if (priv->searchbar == NULL)
 		return;
 
-	gtk_widget_size_request (priv->searchbar, &child_requisition);
-	requisition->width = MAX (requisition->width, child_requisition.width);
-	requisition->height += child_requisition.height;
+	gtk_widget_get_preferred_height (priv->searchbar, &min, &nat);
+        *minimum += min;
+        *natural += nat;
 }
 
 static void
@@ -267,7 +290,7 @@ shell_content_size_allocate (GtkWidget *widget,
 	child_allocation.y += child_requisition.height;
 
 	if (gtk_widget_get_visible (child))
-		gtk_widget_size_request (child, &child_requisition);
+		gtk_widget_get_preferred_size (child, &child_requisition, NULL);
 	else
 		child_requisition.height = 0;
 
@@ -282,7 +305,7 @@ shell_content_size_allocate (GtkWidget *widget,
 	child_allocation.y += child_requisition.height;
 
 	if (child != NULL)
-		gtk_widget_size_request (child, &child_requisition);
+		gtk_widget_get_preferred_size (child, &child_requisition, NULL);
 	else
 		child_requisition.height = 0;
 
@@ -398,7 +421,8 @@ e_shell_content_class_init (EShellContentClass *class)
 	object_class->constructed = shell_content_constructed;
 
 	widget_class = GTK_WIDGET_CLASS (class);
-	widget_class->size_request = shell_content_size_request;
+        widget_class->get_preferred_width = shell_content_get_preferred_width;
+        widget_class->get_preferred_height = shell_content_get_preferred_height;
 	widget_class->size_allocate = shell_content_size_allocate;
 
 	container_class = GTK_CONTAINER_CLASS (class);
diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c
index 29c7f29..51a2da9 100644
--- a/shell/e-shell-meego.c
+++ b/shell/e-shell-meego.c
@@ -106,7 +106,7 @@ e_shell_detect_meego (gboolean *is_meego,
 						&dummy_t, &dummy_i, &dummy_l, &dummy_l,
 						&moblin_string);
 
-		gdk_error_trap_pop ();
+		gdk_error_trap_pop_ignored ();
 	}
 
 	if (moblin_string) {
diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c
index a7cb28e..bfd2f76 100644
--- a/shell/e-shell-sidebar.c
+++ b/shell/e-shell-sidebar.c
@@ -220,25 +220,44 @@ shell_sidebar_constructed (GObject *object)
 }
 
 static void
-shell_sidebar_size_request (GtkWidget *widget,
-                            GtkRequisition *requisition)
+shell_sidebar_get_preferred_width (GtkWidget *widget,
+                                   gint      *minimum,
+                                   gint      *natural)
 {
 	EShellSidebarPrivate *priv;
-	GtkRequisition child_requisition;
+        gint child_min, child_nat;
 	GtkWidget *child;
 
 	priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget);
 
-	requisition->width = 0;
-	requisition->height = 0;
+	child = gtk_bin_get_child (GTK_BIN (widget));
+        gtk_widget_get_preferred_width (child, minimum, natural);
+
+	child = priv->event_box;
+        gtk_widget_get_preferred_width (child, &child_min, &child_nat);
+        *minimum = MAX (*minimum, child_min);
+        *natural = MAX (*natural, child_nat);
+}
+
+static void
+shell_sidebar_get_preferred_height (GtkWidget *widget,
+                                    gint      *minimum,
+                                    gint      *natural)
+{
+	EShellSidebarPrivate *priv;
+        gint child_min, child_nat;
+	GtkWidget *child;
+
+	priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget);
 
 	child = gtk_bin_get_child (GTK_BIN (widget));
-	gtk_widget_size_request (child, requisition);
+	gtk_widget_get_preferred_height (child, minimum, natural);
 
 	child = priv->event_box;
-	gtk_widget_size_request (child, &child_requisition);
-	requisition->width = MAX (requisition->width, child_requisition.width);
-	requisition->height += child_requisition.height;
+	gtk_widget_get_preferred_height (child, &child_min, &child_nat);
+
+        *minimum += child_min;
+        *natural += child_nat;
 }
 
 static void
@@ -255,7 +274,7 @@ shell_sidebar_size_allocate (GtkWidget *widget,
 	gtk_widget_set_allocation (widget, allocation);
 
 	child = priv->event_box;
-	gtk_widget_size_request (child, &child_requisition);
+	gtk_widget_get_preferred_size (child, &child_requisition, NULL);
 
 	child_allocation.x = allocation->x;
 	child_allocation.y = allocation->y;
@@ -308,7 +327,8 @@ e_shell_sidebar_class_init (EShellSidebarClass *class)
 	object_class->constructed = shell_sidebar_constructed;
 
 	widget_class = GTK_WIDGET_CLASS (class);
-	widget_class->size_request = shell_sidebar_size_request;
+        widget_class->get_preferred_width = shell_sidebar_get_preferred_width;
+        widget_class->get_preferred_height = shell_sidebar_get_preferred_height;
 	widget_class->size_allocate = shell_sidebar_size_allocate;
 
 	container_class = GTK_CONTAINER_CLASS (class);
diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c
index fec943c..f9270cf 100644
--- a/shell/e-shell-switcher.c
+++ b/shell/e-shell-switcher.c
@@ -100,7 +100,7 @@ shell_switcher_layout_actions (EShellSwitcher *switcher)
 		GtkWidget *widget = p->data;
 		GtkRequisition requisition;
 
-		gtk_widget_size_request (widget, &requisition);
+		gtk_widget_get_preferred_size (widget, &requisition, NULL);
 		max_height = MAX (max_height, requisition.height);
 		max_width = MAX (max_width, requisition.width);
 	}
@@ -247,8 +247,9 @@ shell_switcher_dispose (GObject *object)
 }
 
 static void
-shell_switcher_size_request (GtkWidget *widget,
-                             GtkRequisition *requisition)
+shell_switcher_get_preferred_width (GtkWidget *widget,
+                                    gint      *minimum,
+                                    gint      *natural)
 {
 	EShellSwitcherPrivate *priv;
 	GtkWidget *child;
@@ -256,28 +257,60 @@ shell_switcher_size_request (GtkWidget *widget,
 
 	priv = E_SHELL_SWITCHER_GET_PRIVATE (widget);
 
-	requisition->width = 0;
-	requisition->height = 0;
+        *minimum = *natural = 0;
 
 	child = gtk_bin_get_child (GTK_BIN (widget));
 	if (child != NULL)
-		gtk_widget_size_request (child, requisition);
+		gtk_widget_get_preferred_width (child, minimum, natural);
 
 	if (!priv->toolbar_visible)
 		return;
 
 	for (iter = priv->proxies; iter != NULL; iter = iter->next) {
 		GtkWidget *widget = iter->data;
-		GtkRequisition child_requisition;
+                gint child_min, child_nat;
 
-		gtk_widget_size_request (widget, &child_requisition);
+		gtk_widget_get_preferred_width (widget, &child_min, &child_nat);
 
-		child_requisition.width += H_PADDING;
-		child_requisition.height += V_PADDING;
+                child_min += H_PADDING;
+                child_nat += H_PADDING;
 
-		requisition->width = MAX (
-			requisition->width, child_requisition.width);
-		requisition->height += child_requisition.height;
+                *minimum = MAX (*minimum, child_min);
+                *natural = MAX (*natural, child_nat);
+	}
+}
+
+static void
+shell_switcher_get_preferred_height (GtkWidget *widget,
+                                     gint      *minimum,
+                                     gint      *natural)
+{
+	EShellSwitcherPrivate *priv;
+	GtkWidget *child;
+	GList *iter;
+
+	priv = E_SHELL_SWITCHER_GET_PRIVATE (widget);
+
+        *minimum = *natural = 0;
+
+	child = gtk_bin_get_child (GTK_BIN (widget));
+	if (child != NULL)
+		gtk_widget_get_preferred_height (child, minimum, natural);
+
+	if (!priv->toolbar_visible)
+		return;
+
+	for (iter = priv->proxies; iter != NULL; iter = iter->next) {
+		GtkWidget *widget = iter->data;
+                gint child_min, child_nat;
+
+		gtk_widget_get_preferred_height (widget, &child_min, &child_nat);
+
+                child_min += V_PADDING;
+                child_nat += V_PADDING;
+
+                *minimum += child_min;
+                *natural += child_nat;
 	}
 }
 
@@ -451,7 +484,8 @@ e_shell_switcher_class_init (EShellSwitcherClass *class)
 	object_class->dispose = shell_switcher_dispose;
 
 	widget_class = GTK_WIDGET_CLASS (class);
-	widget_class->size_request = shell_switcher_size_request;
+        widget_class->get_preferred_width = shell_switcher_get_preferred_width;
+        widget_class->get_preferred_height = shell_switcher_get_preferred_height;
 	widget_class->size_allocate = shell_switcher_size_allocate;
 	widget_class->screen_changed = shell_switcher_screen_changed;
 
diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c
index 77bab88..7cadf57 100644
--- a/widgets/misc/e-attachment-button.c
+++ b/widgets/misc/e-attachment-button.c
@@ -93,7 +93,7 @@ attachment_button_menu_position (GtkMenu *menu,
 
 	widget = GTK_WIDGET (button);
 	toggle_button = button->priv->toggle_button;
-	gtk_widget_size_request (GTK_WIDGET (menu), &menu_requisition);
+	gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_requisition, NULL);
 
 	window = gtk_widget_get_parent_window (widget);
 	screen = gtk_widget_get_screen (GTK_WIDGET (menu));
diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c
index 7a72a43..091b5f9 100644
--- a/widgets/misc/e-calendar.c
+++ b/widgets/misc/e-calendar.c
@@ -288,26 +288,37 @@ e_calendar_style_set		(GtkWidget	*widget,
 }
 
 static void
-e_calendar_size_request		(GtkWidget      *widget,
-				 GtkRequisition *requisition)
+e_calendar_get_preferred_width (GtkWidget *widget,
+                                gint      *minimum,
+                                gint      *natural)
 {
 	ECalendar *cal;
 	GtkStyle *style;
-	gint col_width, row_height, width, height;
+	gint col_width;
 
 	cal = E_CALENDAR (widget);
 	style = gtk_widget_get_style (GTK_WIDGET (cal));
 
-	g_object_get ((cal->calitem),
-			"row_height", &row_height,
-			"column_width", &col_width,
-			NULL);
+	g_object_get ((cal->calitem), "column_width", &col_width, NULL);
+
+	*minimum = *natural = col_width * cal->min_cols + style->xthickness * 2;
+}
+
+static void
+e_calendar_get_preferred_height (GtkWidget *widget,
+                                 gint      *minimum,
+                                 gint      *natural)
+{
+	ECalendar *cal;
+	GtkStyle *style;
+	gint row_height;
+
+	cal = E_CALENDAR (widget);
+	style = gtk_widget_get_style (GTK_WIDGET (cal));
 
-	height = row_height * cal->min_rows;
-	width = col_width * cal->min_cols;
+	g_object_get ((cal->calitem), "row_height", &row_height, NULL);
 
-	requisition->width = width + style->xthickness * 2;
-	requisition->height = height + style->ythickness * 2;
+	*minimum = *natural = row_height * cal->min_rows + style->ythickness * 2;
 }
 
 static void
diff --git a/widgets/misc/e-cell-renderer-combo.c b/widgets/misc/e-cell-renderer-combo.c
index a2b65b2..9c2c288 100644
--- a/widgets/misc/e-cell-renderer-combo.c
+++ b/widgets/misc/e-cell-renderer-combo.c
@@ -102,7 +102,7 @@ ecrc_get_size (GtkCellRenderer *cell, GtkWidget *widget, GdkRectangle *cell_area
 
 	btn = gtk_button_new ();
 	gtk_container_add (GTK_CONTAINER (btn), gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE));
-	gtk_widget_size_request (btn, &req);
+	gtk_widget_get_preferred_size (btn, &req, NULL);
 	*width += req.width;
 	gtk_widget_destroy (btn);
 }
diff --git a/widgets/misc/e-combo-cell-editable.c b/widgets/misc/e-combo-cell-editable.c
index b32a3a1..f108e71 100644
--- a/widgets/misc/e-combo-cell-editable.c
+++ b/widgets/misc/e-combo-cell-editable.c
@@ -212,7 +212,7 @@ position_popup (EComboCellEditable *ecce, gint x, gint y, gint offset)
 	GtkRequisition req;
 
 	gtk_widget_realize (ecce->priv->popup);
-	gtk_widget_size_request (ecce->priv->popup, &req);
+	gtk_widget_get_preferred_size (ecce->priv->popup, &req, NULL);
 
 	if (req.height > gdk_screen_height () - y) {
 		y -= (offset + req.height);
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index 2a0fc43..8aa048c 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -1399,12 +1399,12 @@ position_date_popup		(EDateEdit	*dedit)
 	GtkRequisition cal_req, button_req;
 	gint screen_width, screen_height;
 
-	gtk_widget_size_request (dedit->priv->cal_popup, &cal_req);
+	gtk_widget_get_preferred_size (dedit->priv->cal_popup, &cal_req, NULL);
 
-	gtk_widget_size_request (dedit->priv->date_button, &button_req);
+	gtk_widget_get_preferred_size (dedit->priv->date_button, &button_req, NULL);
 	bwidth = button_req.width;
-	gtk_widget_size_request (
-		gtk_widget_get_parent (dedit->priv->date_button), &button_req);
+	gtk_widget_get_preferred_size (
+		gtk_widget_get_parent (dedit->priv->date_button), &button_req, NULL);
 	bheight = button_req.height;
 
 	gtk_widget_translate_coordinates (
diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c
index 07f7111..9c20faa 100644
--- a/widgets/misc/e-map.c
+++ b/widgets/misc/e-map.c
@@ -444,44 +444,35 @@ e_map_unrealize (GtkWidget *widget)
 }
 
 static void
-e_map_size_request (GtkWidget *widget, GtkRequisition *requisition)
+e_map_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural)
 {
 	EMap *map;
 
 	g_return_if_fail (widget != NULL);
 	g_return_if_fail (E_IS_MAP (widget));
-	g_return_if_fail (requisition != NULL);
 
 	map = E_MAP (widget);
 
 	/* TODO: Put real sizes here. */
 
-	requisition->width = gdk_pixbuf_get_width (map->priv->map_pixbuf);
-	requisition->height = gdk_pixbuf_get_height (map->priv->map_pixbuf);
+	*minimum = *natural = gdk_pixbuf_get_width (priv->map_pixbuf);
 }
 
 static void
-e_map_get_preferred_height (GtkWidget *widget,
-			    gint      *minimal_height,
-			    gint      *natural_height)
+e_map_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural)
 {
-	GtkRequisition requisition;
+	EMap *view;
+	EMapPrivate *priv;
 
-	e_map_size_request (widget, &requisition);
+	g_return_if_fail (widget != NULL);
+	g_return_if_fail (E_IS_MAP (widget));
 
-	*minimal_height = *natural_height = requisition.height;
-}
+	view = E_MAP (widget);
+	priv = view->priv;
 
-static void
-e_map_get_preferred_width (GtkWidget *widget,
-			   gint      *minimal_width,
-			   gint      *natural_width)
-{
-	GtkRequisition requisition;
-
-	e_map_size_request (widget, &requisition);
+	/* TODO: Put real sizes here. */
 
-	*minimal_width = *natural_width = requisition.width;
+	*minimum = *natural = gdk_pixbuf_get_height (priv->map_pixbuf);
 }
 
 static void
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
index 3e45d85..85e763e 100644
--- a/widgets/table/e-cell-combo.c
+++ b/widgets/table/e-cell-combo.c
@@ -444,7 +444,7 @@ e_cell_combo_get_popup_pos		(ECellCombo	*ecc,
 	widget = gtk_scrolled_window_get_vscrollbar (popup);
 	gtk_widget_get_child_requisition (widget, &requisition);
 
-	gtk_widget_size_request (ecc->popup_tree_view, &list_requisition);
+	gtk_widget_get_preferred_size (ecc->popup_tree_view, &list_requisition, NULL);
 	min_height = MIN (list_requisition.height, requisition.height);
 	if (!gtk_tree_model_iter_n_children (gtk_tree_view_get_model (GTK_TREE_VIEW (ecc->popup_tree_view)), NULL))
 		list_requisition.height += E_CELL_COMBO_LIST_EMPTY_HEIGHT;
diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c
index 70c348d..da88257 100644
--- a/widgets/table/e-cell-date-edit.c
+++ b/widgets/table/e-cell-date-edit.c
@@ -685,7 +685,7 @@ e_cell_date_edit_get_popup_pos		(ECellDateEdit	*ecde,
 	   the vertical scrollbar in case we need to show that. */
 	screen_width = gdk_screen_width ();
 
-	gtk_widget_size_request (ecde->popup_window, &popup_requisition);
+	gtk_widget_get_preferred_size (ecde->popup_window, &popup_requisition, NULL);
 
 	/* Calculate the desired width. */
 	*width = popup_requisition.width;
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index b9e6f8e..1002b1f 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -225,14 +225,21 @@ current_search_col (ETable *et)
 	return et->current_search_col;
 }
 
-static void
-et_size_request (GtkWidget *widget, GtkRequisition *request)
+static_void
+et_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural)
 {
 	ETable *et = E_TABLE (widget);
-	if (GTK_WIDGET_CLASS (e_table_parent_class)->size_request)
-		GTK_WIDGET_CLASS (e_table_parent_class)->size_request (widget, request);
-	if (et->horizontal_resize)
-		request->width = MAX (request->width, et->header_width);
+	GTK_WIDGET_CLASS (e_table_parent_class)->get_preferred_width (widget, minimum, natural);
+	if (et->horizontal_resize) {
+                *minimum = MAX (*minimum, et->header_width);
+                *natural = MAX (*natural, et->header_width);
+        }
+}
+
+static_void
+et_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural)
+{
+        GTK_WIDGET_CLASS (e_table_parent_class)->get_preferred_height (widget, minimum, natural);
 }
 
 static void
@@ -3236,7 +3243,8 @@ e_table_class_init (ETableClass *class)
 
 	widget_class->grab_focus        = et_grab_focus;
 	widget_class->unrealize         = et_unrealize;
-	widget_class->size_request      = et_size_request;
+        widget_class->get_preferred_width = et_get_preferred_width;
+        widget_class->get_preferred_height = et_get_preferred_height;
 
 	widget_class->focus             = et_focus;
 



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