diff options
author | Rodrigo Moya <rodrigo@gnome-db.org> | 2010-12-10 20:15:27 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:26 +0800 |
commit | b5aba428f4d7daca78a6b079e1766d9fba5a8bc3 (patch) | |
tree | c8cd9400a62f2cf2b3ba84bd6e6b01774f2b3085 /shell/e-shell-content.c | |
parent | cd633936b1f2f2e8c678dfb4e3e38ba9713e41a4 (diff) | |
download | gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.tar.gz gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.tar.zst gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.zip |
Adapt size_request vfuncs to latest gtk+-3.0 API.
Diffstat (limited to 'shell/e-shell-content.c')
-rw-r--r-- | shell/e-shell-content.c | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 38b62738be..586b706859 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_get_preferred_size (child, requisition, NULL); + 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_get_preferred_size (priv->alert_bar, &child_requisition, NULL); - 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_get_preferred_size (priv->searchbar, &child_requisition, NULL); - 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 @@ -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); |