[gtk+/gtk-style-context: 342/533] GtkWidget: Update pango context from style context's font description.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 342/533] GtkWidget: Update pango context from style context's font description.
- Date: Wed, 1 Dec 2010 02:34:33 +0000 (UTC)
commit 97f5174660b68fab9a12b53864de8b66bb99a5af
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 9 18:31:39 2010 +0100
GtkWidget: Update pango context from style context's font description.
gtk/gtkwidget.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index bba2fbf..4262771 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8697,12 +8697,22 @@ static void
update_pango_context (GtkWidget *widget,
PangoContext *context)
{
- GtkWidgetPrivate *priv = widget->priv;
+ PangoFontDescription *font_desc;
+ GtkStyleContext *style_context;
+
+ style_context = gtk_widget_get_style_context (widget);
- pango_context_set_font_description (context, priv->style->font_desc);
+ gtk_style_context_get (style_context,
+ gtk_widget_get_state_flags (widget),
+ "font", &font_desc,
+ NULL);
+
+ pango_context_set_font_description (context, font_desc);
pango_context_set_base_dir (context,
gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL);
+
+ pango_font_description_free (font_desc);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]