diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-13 23:54:58 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-01-15 03:58:29 +0800 |
commit | 0af3ff804c0d71c76fd63f0a2a152cac7de64863 (patch) | |
tree | e80b7e357654f0dcc3cef08e1d2d459b9cf45d85 /shell/e-shell-switcher.c | |
parent | 7087e222f8422470c44ce2ecd5c598fefd2315fc (diff) | |
download | gsoc2013-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-switcher.c')
-rw-r--r-- | shell/e-shell-switcher.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index fec943c021..6dbcc86fb1 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -30,6 +30,9 @@ #include <glib/gi18n.h> #include <e-util/e-extensible.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_SHELL_SWITCHER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate)) @@ -100,7 +103,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); } @@ -261,7 +264,7 @@ shell_switcher_size_request (GtkWidget *widget, child = gtk_bin_get_child (GTK_BIN (widget)); if (child != NULL) - gtk_widget_size_request (child, requisition); + gtk_widget_get_preferred_size (child, requisition, NULL); if (!priv->toolbar_visible) return; @@ -270,7 +273,7 @@ shell_switcher_size_request (GtkWidget *widget, GtkWidget *widget = iter->data; GtkRequisition child_requisition; - gtk_widget_size_request (widget, &child_requisition); + gtk_widget_get_preferred_size (widget, &child_requisition, NULL); child_requisition.width += H_PADDING; child_requisition.height += V_PADDING; |