[nautilus/gtk3-breakage] editable-label: don't use deprecated size_request vfunc



commit 859a7177c15d4e39cff3187ef41c6ecb14d9c763
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Oct 28 13:42:03 2010 +0200

    editable-label: don't use deprecated size_request vfunc

 eel/eel-editable-label.c |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 531a223..7e5c5e8 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -71,8 +71,12 @@ static void     eel_editable_label_get_property            (GObject
 							    GValue                *value,
 							    GParamSpec            *pspec);
 static void     eel_editable_label_finalize                (GObject               *object);
-static void     eel_editable_label_size_request            (GtkWidget             *widget,
-							    GtkRequisition        *requisition);
+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);
 static void     eel_editable_label_size_allocate           (GtkWidget             *widget,
 							    GtkAllocation         *allocation);
 static void     eel_editable_label_state_changed           (GtkWidget             *widget,
@@ -211,7 +215,8 @@ eel_editable_label_class_init (EelEditableLabelClass *class)
   gobject_class->get_property = eel_editable_label_get_property;
   gobject_class->finalize = eel_editable_label_finalize;
 
-  widget_class->size_request = eel_editable_label_size_request;
+  widget_class->get_preferred_width = eel_editable_label_get_preferred_width;
+  widget_class->get_preferred_height = eel_editable_label_get_preferred_height;
   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;
@@ -1132,6 +1137,30 @@ eel_editable_label_size_request (GtkWidget      *widget,
 }
 
 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;
+}
+
+static void
 eel_editable_label_size_allocate (GtkWidget     *widget,
 				  GtkAllocation *allocation)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]