gtksettings: unset attributes set to normal from font description

So that they do not override values coming from the theme.

Based on a patch by Carlos Garnacho.

https://bugzilla.gnome.org/show_bug.cgi?id=645458
This commit is contained in:
Cosimo Cecchi 2011-03-22 14:51:06 -04:00
parent ec2055d1b0
commit 24bba4cc56

View File

@ -1345,6 +1345,24 @@ gtk_settings_get_style (GtkStyleProvider *provider,
font_desc = pango_font_description_from_string (font_name);
/* Unset normal attributes from this description,
* so they do not override theme values */
if (pango_font_description_get_weight (font_desc) == PANGO_WEIGHT_NORMAL)
pango_font_description_unset_fields (font_desc,
PANGO_FONT_MASK_WEIGHT);
if (pango_font_description_get_stretch (font_desc) == PANGO_STRETCH_NORMAL)
pango_font_description_unset_fields (font_desc,
PANGO_FONT_MASK_STRETCH);
if (pango_font_description_get_variant (font_desc) == PANGO_VARIANT_NORMAL)
pango_font_description_unset_fields (font_desc,
PANGO_FONT_MASK_VARIANT);
if (pango_font_description_get_style (font_desc) == PANGO_STYLE_NORMAL)
pango_font_description_unset_fields (font_desc,
PANGO_FONT_MASK_STYLE);
gtk_style_properties_set (props, 0,
"font", font_desc,
NULL);