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 /widgets/misc | |
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 'widgets/misc')
-rw-r--r-- | widgets/misc/e-attachment-button.c | 5 | ||||
-rw-r--r-- | widgets/misc/e-cell-renderer-combo.c | 5 | ||||
-rw-r--r-- | widgets/misc/e-combo-cell-editable.c | 2 | ||||
-rw-r--r-- | widgets/misc/e-dateedit.c | 8 |
4 files changed, 13 insertions, 7 deletions
diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c index 77bab884c9..19af142ac7 100644 --- a/widgets/misc/e-attachment-button.c +++ b/widgets/misc/e-attachment-button.c @@ -23,6 +23,9 @@ #include "e-attachment-button.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_ATTACHMENT_BUTTON_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_ATTACHMENT_BUTTON, EAttachmentButtonPrivate)) @@ -93,7 +96,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-cell-renderer-combo.c b/widgets/misc/e-cell-renderer-combo.c index a2b65b27be..03156f1801 100644 --- a/widgets/misc/e-cell-renderer-combo.c +++ b/widgets/misc/e-cell-renderer-combo.c @@ -27,6 +27,9 @@ #include "e-combo-cell-editable.h" #include "e-cell-renderer-combo.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + enum { PROP_0, PROP_LIST @@ -102,7 +105,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 aa514630ee..613fc7b2f6 100644 --- a/widgets/misc/e-combo-cell-editable.c +++ b/widgets/misc/e-combo-cell-editable.c @@ -215,7 +215,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 d0b9b7ea8f..098825a321 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -1411,12 +1411,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 ( |