Revert "app: create pango font description of statusbar zoom field only once..."
This reverts commit 6878b49491
.
I didn't take into consideration that different themes could apply
various fonts, font sizes or label-scale for the widget. So the font
description needs to be reinitialized at every theme change.
This commit is contained in:
@ -212,33 +212,32 @@ static void
|
|||||||
gimp_scale_combo_box_style_set (GtkWidget *widget,
|
gimp_scale_combo_box_style_set (GtkWidget *widget,
|
||||||
GtkStyle *prev_style)
|
GtkStyle *prev_style)
|
||||||
{
|
{
|
||||||
GtkWidget *entry;
|
GtkWidget *entry;
|
||||||
GtkRcStyle *rc_style;
|
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_CLASS (parent_class)->style_set (widget, prev_style);
|
||||||
|
|
||||||
|
gtk_widget_style_get (widget, "label-scale", &label_scale, NULL);
|
||||||
|
|
||||||
entry = gtk_bin_get_child (GTK_BIN (widget));
|
entry = gtk_bin_get_child (GTK_BIN (widget));
|
||||||
|
|
||||||
rc_style = gtk_widget_get_modifier_style (GTK_WIDGET (entry));
|
rc_style = gtk_widget_get_modifier_style (GTK_WIDGET (entry));
|
||||||
|
|
||||||
if (! rc_style->font_desc)
|
if (rc_style->font_desc)
|
||||||
{
|
pango_font_description_free (rc_style->font_desc);
|
||||||
PangoContext *context;
|
|
||||||
PangoFontDescription *font_desc;
|
|
||||||
gint font_size;
|
|
||||||
gdouble label_scale;
|
|
||||||
|
|
||||||
gtk_widget_style_get (widget, "label-scale", &label_scale, NULL);
|
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_size = pango_font_description_get_size (rc_style->font_desc);
|
||||||
font_desc = pango_context_get_font_description (context);
|
pango_font_description_set_size (rc_style->font_desc, label_scale * font_size);
|
||||||
rc_style->font_desc = pango_font_description_copy (font_desc);
|
|
||||||
|
|
||||||
font_size = pango_font_description_get_size (rc_style->font_desc);
|
gtk_widget_modify_style (GTK_WIDGET (entry), rc_style);
|
||||||
pango_font_description_set_size (rc_style->font_desc, label_scale * font_size);
|
|
||||||
|
|
||||||
gtk_widget_modify_style (GTK_WIDGET (entry), rc_style);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user