summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-art-gtk-extensions.c6
-rw-r--r--eel/eel-editable-label.c8
-rw-r--r--eel/eel-labeled-image.c10
-rw-r--r--eel/eel-wrap-table.c8
4 files changed, 22 insertions, 10 deletions
diff --git a/eel/eel-art-gtk-extensions.c b/eel/eel-art-gtk-extensions.c
index 59963583..f7009991 100644
--- a/eel/eel-art-gtk-extensions.c
+++ b/eel/eel-art-gtk-extensions.c
@@ -27,6 +27,10 @@
#include "eel-art-gtk-extensions.h"
#include <gdk/gdkx.h>
+#if !GTK_CHECK_VERSION(3,0,0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
/**
* eel_gdk_rectangle_to_eel_irect:
* @gdk_rectangle: The source GdkRectangle.
@@ -191,7 +195,7 @@ eel_gtk_widget_get_preferred_dimensions (GtkWidget *gtk_widget)
g_return_val_if_fail (GTK_IS_WIDGET (gtk_widget), eel_dimensions_empty);
- gtk_widget_size_request (gtk_widget, &requisition);
+ gtk_widget_get_preferred_size (gtk_widget, &requisition, NULL);
preferred_dimensions.width = (int) requisition.width;
preferred_dimensions.height = (int) requisition.height;
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 3edd68ef..08688cd3 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -44,6 +44,10 @@
#define GtkEditableInterface GtkEditableClass
#endif
+#if !GTK_CHECK_VERSION(3,0,0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
/* g_memmove is removed in glib 2.40 */
#if GLIB_CHECK_VERSION (2, 39, 0)
#define g_memmove memmove
@@ -1331,11 +1335,7 @@ get_layout_location (EelEditableLabel *label,
if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
xalign = 1.0 - xalign;
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_get_preferred_size (widget, &req, NULL);
-#else
- gtk_widget_size_request (widget, &req);
-#endif
gtk_misc_get_padding (misc, &xpad, &ypad);
gtk_widget_get_allocation (widget, &allocation);
diff --git a/eel/eel-labeled-image.c b/eel/eel-labeled-image.c
index dbaa47aa..2292978a 100644
--- a/eel/eel-labeled-image.c
+++ b/eel/eel-labeled-image.c
@@ -41,6 +41,10 @@
#define DEFAULT_X_ALIGNMENT 0.5
#define DEFAULT_Y_ALIGNMENT 0.5
+#if !GTK_CHECK_VERSION(3,0,0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
/* Signals */
enum
{
@@ -731,7 +735,7 @@ labeled_image_get_image_dimensions (const EelLabeledImage *labeled_image)
return eel_dimensions_empty;
}
- gtk_widget_size_request (labeled_image->details->image, &image_requisition);
+ gtk_widget_get_preferred_size (labeled_image->details->image, &image_requisition, NULL);
image_dimensions.width = (int) image_requisition.width;
image_dimensions.height = (int) image_requisition.height;
@@ -757,7 +761,7 @@ labeled_image_get_label_dimensions (const EelLabeledImage *labeled_image)
return eel_dimensions_empty;
}
- gtk_widget_size_request (labeled_image->details->label, &label_requisition);
+ gtk_widget_get_preferred_size (labeled_image->details->label, &label_requisition, NULL);
label_dimensions.width = (int) label_requisition.width;
label_dimensions.height = (int) label_requisition.height;
@@ -852,7 +856,7 @@ eel_labeled_image_get_image_bounds (const EelLabeledImage *labeled_image)
/* get true real dimensions if we're in fixed height mode */
if (is_fixed_height (labeled_image) && labeled_image_show_image (labeled_image))
{
- gtk_widget_size_request (labeled_image->details->image, &image_requisition);
+ gtk_widget_get_preferred_size (labeled_image->details->image, &image_requisition, NULL);
image_dimensions.width = (int) image_requisition.width;
image_dimensions.height = (int) image_requisition.height;
}
diff --git a/eel/eel-wrap-table.c b/eel/eel-wrap-table.c
index d5be8ae5..99592a90 100644
--- a/eel/eel-wrap-table.c
+++ b/eel/eel-wrap-table.c
@@ -30,6 +30,10 @@
#include "eel-gtk-extensions.h"
#include <gtk/gtk.h>
+#if !GTK_CHECK_VERSION(3,0,0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
/* Arguments */
enum
{
@@ -587,7 +591,7 @@ wrap_table_layout (EelWrapTable *wrap_table)
{
GtkRequisition item_requisition;
- gtk_widget_size_request (item, &item_requisition);
+ gtk_widget_get_preferred_size (item, &item_requisition, NULL);
item_allocation.x = pos.x;
item_allocation.y = pos.y;
@@ -675,7 +679,7 @@ wrap_table_get_max_child_dimensions (const EelWrapTable *wrap_table)
GtkRequisition child_requisition;
EelDimensions child_dimensions;
- gtk_widget_size_request (child, &child_requisition);
+ gtk_widget_get_preferred_size (child, &child_requisition, NULL);
child_dimensions.width = (int) child_requisition.width;
child_dimensions.height = (int) child_requisition.height;