aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
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 /widgets
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 'widgets')
-rw-r--r--widgets/misc/e-attachment-button.c5
-rw-r--r--widgets/misc/e-cell-renderer-combo.c5
-rw-r--r--widgets/misc/e-combo-cell-editable.c2
-rw-r--r--widgets/misc/e-dateedit.c8
-rw-r--r--widgets/table/e-cell-combo.c2
-rw-r--r--widgets/table/e-cell-date-edit.c2
6 files changed, 15 insertions, 9 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 (
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
index d4ba4f31e3..6e1eb5ca80 100644
--- a/widgets/table/e-cell-combo.c
+++ b/widgets/table/e-cell-combo.c
@@ -447,7 +447,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 73a5d946b2..005f7a63e4 100644
--- a/widgets/table/e-cell-date-edit.c
+++ b/widgets/table/e-cell-date-edit.c
@@ -688,7 +688,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;