summaryrefslogtreecommitdiff
path: root/eel/eel-editable-label.c
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-11-08 08:42:47 +0200
committerJasmine Hassan <[email protected]>2012-11-16 09:45:53 +0200
commitdecb73c787a2709f977305a4a6da052227d7b37d (patch)
tree6f5354fb1585f89972dfea1d2bb134121b0e69c2 /eel/eel-editable-label.c
parentcb95554ed52fc0c5d996de6ae821999d92e15b65 (diff)
downloadcaja-decb73c787a2709f977305a4a6da052227d7b37d.tar.bz2
caja-decb73c787a2709f977305a4a6da052227d7b37d.tar.xz
[editable-label] don't use deprecated size_request vfunc
http://git.gnome.org/browse/nautilus/commit/?id=12c7a03bfe3c49078cb5b44ff2651eb9ce1edce4
Diffstat (limited to 'eel/eel-editable-label.c')
-rw-r--r--eel/eel-editable-label.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index a934f881..f7ec2d41 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -80,8 +80,17 @@ static void eel_editable_label_get_property (GObject
GValue *value,
GParamSpec *pspec);
static void eel_editable_label_finalize (GObject *object);
+#if GTK_CHECK_VERSION(3,0,0)
+static void eel_editable_label_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
+static void eel_editable_label_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
+#else
static void eel_editable_label_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
+ GtkRequisition *requisition);
+#endif
static void eel_editable_label_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void eel_editable_label_state_changed (GtkWidget *widget,
@@ -225,7 +234,12 @@ eel_editable_label_class_init (EelEditableLabelClass *class)
gobject_class->get_property = eel_editable_label_get_property;
gobject_class->finalize = eel_editable_label_finalize;
+#if GTK_CHECK_VERSION(3,0,0)
+ widget_class->get_preferred_width = eel_editable_label_get_preferred_width;
+ widget_class->get_preferred_height = eel_editable_label_get_preferred_height;
+#else
widget_class->size_request = eel_editable_label_size_request;
+#endif
widget_class->size_allocate = eel_editable_label_size_allocate;
widget_class->state_changed = eel_editable_label_state_changed;
widget_class->style_set = eel_editable_label_style_set;
@@ -1148,6 +1162,32 @@ eel_editable_label_size_request (GtkWidget *widget,
requisition->height = height;
}
+#if GTK_CHECK_VERSION(3,0,0)
+static void
+eel_editable_label_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ eel_editable_label_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.width;
+}
+
+static void
+eel_editable_label_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ eel_editable_label_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.height;
+}
+#endif
+
static void
eel_editable_label_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)