From 3f2889e030185e44b07d0bb74d5d1b6bf4e19763 Mon Sep 17 00:00:00 2001 From: Jonathan Tait Date: Sun, 31 Jan 2016 16:25:24 +0000 Subject: [PATCH] Bug 761340 - on changing theme/icon theme, statusbar zoom field shrinks. Apply label-scale once only. --- app/display/gimpscalecombobox.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/app/display/gimpscalecombobox.c b/app/display/gimpscalecombobox.c index 1d0a3b95ff..29e3158b46 100644 --- a/app/display/gimpscalecombobox.c +++ b/app/display/gimpscalecombobox.c @@ -212,32 +212,30 @@ static void gimp_scale_combo_box_style_set (GtkWidget *widget, GtkStyle *prev_style) { - GtkWidget *entry; - GtkRcStyle *rc_style; - gint font_size; - gdouble scale; + GtkWidget *entry; + GtkRcStyle *rc_style; + PangoContext *context; + PangoFontDescription *font_desc; + gint font_size; + gdouble label_scale; GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style); - gtk_widget_style_get (widget, "label-scale", &scale, NULL); + gtk_widget_style_get (widget, "label-scale", &label_scale, NULL); entry = gtk_bin_get_child (GTK_BIN (widget)); rc_style = gtk_widget_get_modifier_style (GTK_WIDGET (entry)); - if (! rc_style->font_desc) - { - PangoContext *context; - PangoFontDescription *font_desc; + if (rc_style->font_desc) + pango_font_description_free (rc_style->font_desc); - context = gtk_widget_get_pango_context (widget); - font_desc = pango_context_get_font_description (context); - - rc_style->font_desc = pango_font_description_copy (font_desc); - } + context = gtk_widget_get_pango_context (widget); + font_desc = pango_context_get_font_description (context); + rc_style->font_desc = pango_font_description_copy (font_desc); font_size = pango_font_description_get_size (rc_style->font_desc); - pango_font_description_set_size (rc_style->font_desc, scale * font_size); + pango_font_description_set_size (rc_style->font_desc, label_scale * font_size); gtk_widget_modify_style (GTK_WIDGET (entry), rc_style); }