summaryrefslogtreecommitdiffstats
path: root/gtk/src/ghbcompat.h
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-01-14 19:00:58 +0000
committerjstebbins <[email protected]>2014-01-14 19:00:58 +0000
commit36b7f949d2257fa1e1262bd441f89f566b04c5d4 (patch)
treea1c157b533b41dd20b3d5e41f8bf7a66e9b8488c /gtk/src/ghbcompat.h
parent7a89045498016168afa0de453118677bd32029e4 (diff)
LinGui: fix deprecated gtk_widget_get_style()
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5971 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/ghbcompat.h')
-rw-r--r--gtk/src/ghbcompat.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gtk/src/ghbcompat.h b/gtk/src/ghbcompat.h
index b352b9d82..47d97fdd6 100644
--- a/gtk/src/ghbcompat.h
+++ b/gtk/src/ghbcompat.h
@@ -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