diff options
author | Benjamin Otte <otte@redhat.com> | 2012-12-06 02:47:24 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-12-06 02:57:18 +0100 |
commit | 7747910b9d9a58bd6a162a497d6cbfd692df132b (patch) | |
tree | 11fc4b34078ac6633d7264af0f81e55de154a441 /gtk/gtkprogressbar.c | |
parent | a405c9917c550b72d8805fce9f29e63ccd57e5ed (diff) | |
download | gtk+-7747910b9d9a58bd6a162a497d6cbfd692df132b.tar.gz |
gtk: Use context's font
Instead of using gtk_style_context_get_font() in
pango_context_get_metrics(), use pango_context_get_font_description().
The context contains the font description we are about to use after all.
Diffstat (limited to 'gtk/gtkprogressbar.c')
-rw-r--r-- | gtk/gtkprogressbar.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index 6b4cf72084..111820cfa0 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -556,15 +556,15 @@ gtk_progress_bar_get_preferred_width (GtkWidget *widget, if (priv->ellipsize) { - const PangoFontDescription *font_desc; PangoContext *context; PangoFontMetrics *metrics; gint char_width; /* The minimum size for ellipsized text is ~ 3 chars */ context = pango_layout_get_context (layout); - font_desc = gtk_style_context_get_font (style_context, state); - metrics = pango_context_get_metrics (context, font_desc, pango_context_get_language (context)); + metrics = pango_context_get_metrics (context, + pango_context_get_font_description (context), + pango_context_get_language (context)); char_width = pango_font_metrics_get_approximate_char_width (metrics); pango_font_metrics_unref (metrics); |