aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-content.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-13 23:54:58 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-15 03:58:29 +0800
commit0af3ff804c0d71c76fd63f0a2a152cac7de64863 (patch)
treee80b7e357654f0dcc3cef08e1d2d459b9cf45d85 /shell/e-shell-content.c
parent7087e222f8422470c44ce2ecd5c598fefd2315fc (diff)
downloadgsoc2013-evolution-0af3ff804c0d71c76fd63f0a2a152cac7de64863.tar.gz
gsoc2013-evolution-0af3ff804c0d71c76fd63f0a2a152cac7de64863.tar.zst
gsoc2013-evolution-0af3ff804c0d71c76fd63f0a2a152cac7de64863.zip
Fudge gtk_widget_get_preferred_size() for gtk2.
Easy enough to fake gtk_widget_get_preferred_size() in gtk2 using gtk_widget_size_request(). Reduces diff noise with gtk3 branch.
Diffstat (limited to 'shell/e-shell-content.c')
-rw-r--r--shell/e-shell-content.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c
index 62cfdd4176..a97c095947 100644
--- a/shell/e-shell-content.c
+++ b/shell/e-shell-content.c
@@ -44,6 +44,9 @@
#include "e-shell-view.h"
#include "e-shell-window-actions.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define E_SHELL_CONTENT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_SHELL_CONTENT, EShellContentPrivate))
@@ -226,16 +229,16 @@ shell_content_size_request (GtkWidget *widget,
requisition->height = 0;
child = gtk_bin_get_child (GTK_BIN (widget));
- gtk_widget_size_request (child, requisition);
+ gtk_widget_get_preferred_size (child, requisition, NULL);
- gtk_widget_size_request (priv->alert_bar, &child_requisition);
+ gtk_widget_get_preferred_size (priv->alert_bar, &child_requisition, NULL);
requisition->width = MAX (requisition->width, child_requisition.width);
requisition->height += child_requisition.height;
if (priv->searchbar == NULL)
return;
- gtk_widget_size_request (priv->searchbar, &child_requisition);
+ gtk_widget_get_preferred_size (priv->searchbar, &child_requisition, NULL);
requisition->width = MAX (requisition->width, child_requisition.width);
requisition->height += child_requisition.height;
}
@@ -267,7 +270,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 +285,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;