diff options
author | Javier Jardón <jjardon@gnome.org> | 2011-05-31 17:10:46 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2011-05-31 19:18:11 +0200 |
commit | fb9e4c2c3774fb4f02758dac053cfa44fe8a78cd (patch) | |
tree | 82ccc070740013b66f6d2ef4d0e4a055abd51234 /gtk/gtkcombobox.c | |
parent | e5c7daa828977999ac8b8c2bd64ef3a6077ed23d (diff) | |
download | gtk+-fb9e4c2c3774fb4f02758dac053cfa44fe8a78cd.tar.gz |
all: avoid boxed structs copying where possible (and 2)
Use the GtkStyleContext accessors for boxed properties where possible,
to reduce allocations.
Diffstat (limited to 'gtk/gtkcombobox.c')
-rw-r--r-- | gtk/gtkcombobox.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 760e77f25b..b4f8211435 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -5252,7 +5252,7 @@ gtk_combo_box_get_preferred_width (GtkWidget *widget, gint font_size, arrow_size; PangoContext *context; PangoFontMetrics *metrics; - PangoFontDescription *font_desc; + const PangoFontDescription *font_desc; GtkWidget *child; gint minimum_width = 0, natural_width = 0; gint child_min, child_nat; @@ -5277,9 +5277,7 @@ gtk_combo_box_get_preferred_width (GtkWidget *widget, state = gtk_widget_get_state_flags (widget); get_widget_padding (widget, &padding); - gtk_style_context_get (style_context, state, - "font", &font_desc, - NULL); + font_desc = gtk_style_context_get_font (style_context, state); context = gtk_widget_get_pango_context (GTK_WIDGET (widget)); metrics = pango_context_get_metrics (context, font_desc, @@ -5287,7 +5285,6 @@ gtk_combo_box_get_preferred_width (GtkWidget *widget, font_size = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) + pango_font_metrics_get_descent (metrics)); pango_font_metrics_unref (metrics); - pango_font_description_free (font_desc); arrow_size = MAX (arrow_size, font_size) * arrow_scaling; |