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 735247 - gtk_icon_theme_add_builtin_icon doesn't properly handle symbolic icons
gtk_icon_theme_add_builtin_icon doesn't properly handle symbolic icons
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: .General
3.13.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-08-22 21:08 UTC by Jim Nelson
Modified: 2014-08-27 18:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jim Nelson 2014-08-22 21:08:42 UTC
What I'm trying to do is store a custom symbolic icon as a GResource and at application startup register it via gtk_icon_theme_add_builtin_icon().  The file is a 16x16 SVG.  The code loads it with gdk_pixbuf_new_from_resource and registers it like so:

gtk_icon_theme_add_builtin_icon("edit-symbolic", 16, pixbuf);

This partially works.  I have a Glade file that references the icon in a GtkToolButton and it is loaded and displayed.  However, it's displayed exactly as it looks in the SVG (i.e. the parts that should be black are grayed).  The symbolic icon is not processed as a symbolic icon.

However, if I leave the icon file on disk and prepend the directory to GtkIconTheme's search directory, the icon is properly loaded and processed as symbolic.

I was expecting add_builtin_icon() to recognize the icon as symbolic by its suffix, but it appears it's not doing this.
Comment 1 Matthias Clasen 2014-08-22 23:49:51 UTC
That is one of the reasons why gtk_icon_theme_add_builtin_icon() has been deprecated in favor of gtk_icon_theme_add_resource_path(),