diff options
Diffstat (limited to 'eel')
-rw-r--r-- | eel/eel-editable-label.c | 42 |
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) |