After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 497412 - GtkCellRendererText restores default values instead of set values to font description
GtkCellRendererText restores default values instead of set values to font des...
Status: RESOLVED DUPLICATE of bug 350882
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.12.x
Other All
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2007-11-16 16:04 UTC by Aike Reyer
Modified: 2007-11-18 18:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkcellrenderertext-fontdescription.patch (7.97 KB, patch)
2007-11-16 16:05 UTC, Aike Reyer
none Details | Review

Description Aike Reyer 2007-11-16 16:04:29 UTC
Please describe the problem:
Although it is possible to set/unset the use of e.g. "background" with "background-set", this is not possible for e.g. "family", "style", "weight".


According to the Subversion changelog this is not intended:
Revision 4843, Tue Sep 25 11:22:23 2001:

    * gtk/gtkcellrenderertext.c gtk/gtktexttag.c: Restore
      the behavior where you could turn family_set (etc) back on
      and get back the values you had before.



Steps to reproduce:
1. set "style" on a GtkCellRendererText to PANGO_STYLE_ITALIC
2. create a GtkTreeViewColumn with that renderer and set attribute "style-set" to a G_TYPE_BOOLEAN column


Actual results:
The style will be PANGO_STYLE_NORMAL as soon as "style-set" is set to FALSE and won't change to PANGO_STYLE_ITALIC.

Expected results:
Style should change according to the value of the G_TYPE_BOOLEAN column between PANGO_STYLE_ITALIC and PANGO_STYLE_NORMAL.

Does this happen every time?
yes

Other information:
To unset the font attributes pango_font_description_unset_fields() is used.
According to
http://library.gnome.org/devel/pango/unstable/pango-Fonts.html#pango-font-description-unset-fields
in current versions of Pango "The unset fields will get back to their default values."

Similar code is used in gtktexttag.c.


I'll attach a patch for gtkcellrenderertext.c with a possible solution:
I keep a private PangoFontDescription with all set properties and restore the attributes from it. Please have a look.
Comment 1 Aike Reyer 2007-11-16 16:05:31 UTC
Created attachment 99214 [details] [review]
gtkcellrenderertext-fontdescription.patch
Comment 2 Kristian Rietveld 2007-11-18 18:32:48 UTC
Basically Pango broke API somewhere in 2005/2006 and we've decided to accept this breakage instead of fixing/working around it.  See 350882 and 355124 for more information.



*** This bug has been marked as a duplicate of 350882 ***