[libgd] two-lines-renderer: Fix warnings with newer GTK+
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] two-lines-renderer: Fix warnings with newer GTK+
- Date: Tue, 24 Nov 2015 14:52:58 +0000 (UTC)
commit 7c1235591c4aa866b28c8b8dabdcb3b9084c5763
Author: Bastien Nocera <hadess hadess net>
Date: Tue Nov 24 14:12:06 2015 +0100
two-lines-renderer: Fix warnings with newer GTK+
The line renderer was generating loads of errors following CSS changes
in GTK+ 3.19.
See https://blogs.gnome.org/mclasen/2015/11/20/a-gtk-update/ for details
and work-arounds.
https://bugzilla.gnome.org/show_bug.cgi?id=758595
libgd/gd-two-lines-renderer.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/libgd/gd-two-lines-renderer.c b/libgd/gd-two-lines-renderer.c
index 7d7f8ba..9840527 100644
--- a/libgd/gd-two-lines-renderer.c
+++ b/libgd/gd-two-lines-renderer.c
@@ -91,10 +91,13 @@ apply_subtitle_style_to_layout (GtkStyleContext *context,
PangoAttrList *layout_attr;
PangoAttribute *attr_color;
- gtk_style_context_get (context, flags,
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, flags);
+ gtk_style_context_get (context, gtk_style_context_get_state (context),
"font", &desc,
"color", &rgba,
NULL);
+ gtk_style_context_restore (context);
/* Set the font size */
pango_font_description_set_size (desc, pango_font_description_get_size (desc) * SUBTITLE_SIZE_PERCENTAGE);
@@ -376,7 +379,11 @@ gd_two_lines_renderer_get_preferred_width (GtkCellRenderer *cell,
/* Fetch the average size of a character */
context = gtk_widget_get_pango_context (widget);
- gtk_style_context_get (style_context, 0, "font", &font_desc, NULL);
+ gtk_style_context_save (style_context);
+ gtk_style_context_set_state (style_context, 0);
+ gtk_style_context_get (style_context, gtk_style_context_get_state (style_context),
+ "font", &font_desc, NULL);
+ gtk_style_context_restore (style_context);
metrics = pango_context_get_metrics (context, font_desc,
pango_context_get_language (context));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]