LinGui: fix deprecated gtk_widget_get_style()
authorjstebbins <jstebbins.hb@gmail.com>
Tue, 14 Jan 2014 19:00:58 +0000 (19:00 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Tue, 14 Jan 2014 19:00:58 +0000 (19:00 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5971 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/ghbcellrenderertext.c
gtk/src/ghbcompat.h

index f65c111e0ff217ed21a16002846c7405c6f9f269..133923f3ab3f977b88099ab58a7ea04f29fa4324 100644 (file)
@@ -1546,7 +1546,7 @@ get_size (GtkCellRenderer *cell,
       PangoFontDescription *font_desc;
       gint row_height;
 
-      font_desc = pango_font_description_copy_static(gtk_widget_get_style(widget)->font_desc);
+      font_desc = pango_font_description_copy_static(ghb_widget_get_font(widget));
       pango_font_description_merge_static(font_desc, celltext->font, TRUE);
 
       if (celltext->scale_set)
index b352b9d821a378a9167dee54a9d439b830d98dd7..47d97fdd683f3d376a3763c10defe343135c1fc4 100644 (file)
@@ -29,6 +29,29 @@ static inline gboolean gtk_widget_get_realized(GtkWidget *widget)
 }
 #endif
 
+static inline PangoFontDescription* ghb_widget_get_font(GtkWidget *widget)
+{
+    PangoFontDescription *font = NULL;
+
+#if GTK_CHECK_VERSION(3, 0, 0)
+    GtkStyleContext *style;
+
+    style = gtk_widget_get_style_context(widget);
+
+#if GTK_CHECK_VERSION(3, 8, 0)
+    gtk_style_context_get(style, GTK_STATE_FLAG_NORMAL,
+                          "font", &font, NULL);
+#else
+    font = gtk_style_context_get_font(style, GTK_STATE_FLAG_NORMAL);
+#endif
+
+#else
+    font = gtk_widget_get_style(widget)->font_desc;
+#endif
+
+    return font;
+} 
+
 #if !GTK_CHECK_VERSION(3, 0, 0)
 #define gtk_widget_override_font gtk_widget_modify_font
 #endif