Re: pango_descr*unset_fields breaks GtkCellRenderer



Mikael Hermansson <tyan linux se> writes:

> In pango/fonts.c: 398  
> 
> void
> pango_font_description_unset_fields (PangoFontDescription *desc,
> 				     PangoFontMask         to_unset)
> {
>   g_return_if_fail (desc != NULL);
> 
>   /* We reset cleared mask values back to defaults, to avoid
>    * having to check the mask for getters.
>    */
> 
> 
> 
> This code breaks GtkCellRenderer set_style/set_weight and similar....
> and makes those propertys unusable....
> 
> for example:
> 
>   g_object(cell, "style", PANGO_STYLE_ITALIC);
>   fileview->column_filename = gtk_tree_view_column_new_with_attributes
> ("Filename", cell, "foreground", 1, "style_set", 2, "text" , 4, NULL);
>   
> now if style_set is set to FALSE it will reset style = PANGO_STYLE_NORMAL
> and next time when you set it to TRUE it's still default.

I believe that there was no intention that this should work before --
that was just a coincidence. Unset values are _unset_; they have no
value. (What is the hue of a transparent pixel?)

(And in fact I changed GtkTextTag and GtkCellRenderer so that the only
way to change a font property from unset to set is to set it to some
value ... you can't do:

 g_object_set (tag, "family_set", TRUE, NULL);

"family_set" will stay false in this case.)

 Now I'm willing to admit that people might disagree with my
interpretation of how this should work, but it seems very strange to
me to say that a value could be unset and still keep storing it's old
value.

                                               Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]