aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@igalia.com>2012-12-10 19:42:03 +0800
committerDiego Escalante Urrelo <diegoe@igalia.com>2012-12-10 23:23:45 +0800
commitbf1c437d6d91bafd35fd156eff0265c45bd7dbc0 (patch)
tree656cabe78a27b40049db3f8b4293a6bb45d369d7
parente213a76fd1a58ba4cd162e3769f4db2a864ea1f7 (diff)
downloadgsoc2013-epiphany-bf1c437d6d91bafd35fd156eff0265c45bd7dbc0.tar
gsoc2013-epiphany-bf1c437d6d91bafd35fd156eff0265c45bd7dbc0.tar.gz
gsoc2013-epiphany-bf1c437d6d91bafd35fd156eff0265c45bd7dbc0.tar.bz2
gsoc2013-epiphany-bf1c437d6d91bafd35fd156eff0265c45bd7dbc0.tar.lz
gsoc2013-epiphany-bf1c437d6d91bafd35fd156eff0265c45bd7dbc0.tar.xz
gsoc2013-epiphany-bf1c437d6d91bafd35fd156eff0265c45bd7dbc0.tar.zst
gsoc2013-epiphany-bf1c437d6d91bafd35fd156eff0265c45bd7dbc0.zip
widgets: do not use deprecated GtkStyleContext API
https://bugzilla.gnome.org/show_bug.cgi?id=689968
-rw-r--r--lib/widgets/ephy-location-entry.c5
-rw-r--r--lib/widgets/gd-main-view.c2
-rw-r--r--lib/widgets/gd-two-lines-renderer.c2
-rw-r--r--src/ephy-notebook.c5
4 files changed, 10 insertions, 4 deletions
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 34e8e48b8..603284b96 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 528c556f2..df7b3c654 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 38d2c9063..b9ec6527a 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 90bb08044..4e16a2f77 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);