diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2010-11-03 11:36:18 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2010-12-04 15:38:34 +0100 |
commit | fb8de847df03b91d3e6f0674021af1fa1ba543b4 (patch) | |
tree | b81a9ea36e69f3fca0d638b05b5b450c74ae819a /gtk/gtkstyleproperties.c | |
parent | af20ba6103d0eae66fc860d6a97af165f2ffd0f2 (diff) | |
download | gtk+-fb8de847df03b91d3e6f0674021af1fa1ba543b4.tar.gz |
GtkStyleProperties: Merge font descriptions on merge()
This is necessary so incomplete font descriptions are ensured to have
family and size.
Diffstat (limited to 'gtk/gtkstyleproperties.c')
-rw-r--r-- | gtk/gtkstyleproperties.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c index df8529bd67..2c3a9558a0 100644 --- a/gtk/gtkstyleproperties.c +++ b/gtk/gtkstyleproperties.c @@ -1059,7 +1059,19 @@ gtk_style_properties_merge (GtkStyleProperties *props, data = &g_array_index (prop_to_merge->values, ValueData, i); value = property_data_get_value (prop, data->state); - if (replace || !G_IS_VALUE (value)) + if (G_VALUE_TYPE (&data->value) == PANGO_TYPE_FONT_DESCRIPTION && + G_IS_VALUE (value)) + { + PangoFontDescription *font_desc; + PangoFontDescription *font_desc_to_merge; + + /* Handle merging of font descriptions */ + font_desc = g_value_get_boxed (value); + font_desc_to_merge = g_value_get_boxed (&data->value); + + pango_font_description_merge (font_desc, font_desc_to_merge, replace); + } + else if (replace || !G_IS_VALUE (value)) { if (!G_IS_VALUE (value)) g_value_init (value, G_VALUE_TYPE (&data->value)); |