[epiphany] widgets: do not use deprecated GtkStyleContext API



commit bf1c437d6d91bafd35fd156eff0265c45bd7dbc0
Author: Diego Escalante Urrelo <diegoe igalia com>
Date:   Mon Dec 10 06:42:03 2012 -0500

    widgets: do not use deprecated GtkStyleContext API
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689968

 lib/widgets/ephy-location-entry.c   |    5 ++++-
 lib/widgets/gd-main-view.c          |    2 +-
 lib/widgets/gd-two-lines-renderer.c |    2 +-
 src/ephy-notebook.c                 |    5 ++++-
 4 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 34e8e48..603284b 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -657,6 +657,7 @@ favicon_create_drag_surface (EphyLocationEntry *entry,
 	char *title = NULL, *address = NULL;
 	GString *text;
 	GtkStyleContext *style;
+	const PangoFontDescription *font_desc;
 	cairo_surface_t *surface;
 	PangoContext *context;
 	PangoLayout  *layout;
@@ -700,8 +701,10 @@ favicon_create_drag_surface (EphyLocationEntry *entry,
 	layout = pango_layout_new (context);
 
 	style = gtk_widget_get_style_context (GTK_WIDGET (entry));
+	gtk_style_context_get (style, GTK_STATE_FLAG_NORMAL,
+			       "font", &font_desc, NULL);
 	metrics = pango_context_get_metrics (context,
-		                             gtk_style_context_get_font (style, GTK_STATE_FLAG_NORMAL),
+		                             font_desc,
 					     pango_context_get_language (context));
 
 	char_width = pango_font_metrics_get_approximate_digit_width (metrics);
diff --git a/lib/widgets/gd-main-view.c b/lib/widgets/gd-main-view.c
index 528c556..df7b3c6 100644
--- a/lib/widgets/gd-main-view.c
+++ b/lib/widgets/gd-main-view.c
@@ -306,7 +306,7 @@ gd_main_view_get_counter_icon (GdMainView *self,
   pango_attr_list_insert (attr_list, attr);
   pango_layout_set_attributes (layout, attr_list);
 
-  desc = gtk_style_context_get_font (context, 0);
+  gtk_style_context_get (context, 0, "font", &desc, NULL);
   pango_layout_set_font_description (layout, desc);
 
   gtk_style_context_get_color (context, 0, &color);
diff --git a/lib/widgets/gd-two-lines-renderer.c b/lib/widgets/gd-two-lines-renderer.c
index 38d2c90..b9ec652 100644
--- a/lib/widgets/gd-two-lines-renderer.c
+++ b/lib/widgets/gd-two-lines-renderer.c
@@ -310,7 +310,7 @@ gd_two_lines_renderer_get_preferred_width (GtkCellRenderer *cell,
 
   /* Fetch the average size of a charachter */
   context = gtk_widget_get_pango_context (widget);
-  font_desc = gtk_style_context_get_font (style_context, 0);
+  gtk_style_context_get (style_context, 0, "font", &font_desc, NULL);
   metrics = pango_context_get_metrics (context, font_desc,
                                        pango_context_get_language (context));
 
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 90bb080..4e16a2f 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -531,13 +531,16 @@ tab_label_style_set_cb (GtkWidget *hbox,
 	PangoFontMetrics *metrics;
 	PangoContext *context;
 	GtkStyleContext *style;
+	const PangoFontDescription *font_desc;
 	GtkWidget *button;
 	int char_width, h, w;
 
 	context = gtk_widget_get_pango_context (hbox);
 	style = gtk_widget_get_style_context (hbox);
+	gtk_style_context_get (style, GTK_STATE_FLAG_NORMAL,
+			       "font", &font_desc, NULL);
 	metrics = pango_context_get_metrics (context,
-					     gtk_style_context_get_font (style, GTK_STATE_FLAG_NORMAL),
+					     font_desc,
 					     pango_context_get_language (context));
 	char_width = pango_font_metrics_get_approximate_digit_width (metrics);
 	pango_font_metrics_unref (metrics);



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