GNOME Bugzilla – Bug 116577
Support named icons at appropriate places in API
Last modified: 2005-05-18 05:39:24 UTC
We should add support for named icons where it makes sense in the GTK+ API. This includes: gtk_window_set_icon_name(), gtk_window_set_default_icon_name() (bug 92364) gtk_image_set_icon_name() gtk_tool_button_set_icon_name() gtk_drag_source_set_icon_name(), gtk_drag_set_icon_name() Maybe gtkcellrendererpixbuf as well? For images and cellrendererpixbuf, there is the question of what the appropriate way of specifying a size is. Using a pixel size - a "icon_pixel_size" property perhaps - is likely most applicable, but in some cases, allowing the symbolic "icon_size" to take effect would be more useful - for example, in the toolbar. Windows have the problem that we might want to get *all* the provided sizes (assuming it isn't an SVG image...) and provide them all as a list. (See the bug report)
I think you meant bug http://bugzilla.gnome.org/show_bug.cgi?id=92346
Will have to wait for 2.6.
gtk_window_set_icon_name() gtk_window_set_default_icon_name() gtk_image_set_icon_name() are already done
Still an issue. Note that I'm working on gtk_drag_source_set_icon_name() and gtk_drag_set_icon_name().
Created attachment 46550 [details] [review] Proposed gtk_drag_(source_)set_icon_name() implementation (against HEAD) I'm currently unable to test whether the proposed patch works.
if (!pixbuf) + { + g_warning ("Cannot load drag icon from icon_name %s", icon_name); + return; + } + Should be unnecessary, since set_icon_stock_pixbuf() will return_if_fail in that case anyway.
Created attachment 46572 [details] [review] gtk_drag_(source_)set_icon_name() implementation, attempt 2 OK, I've removed that part. Note that I've also written a little test and program which suggests that this function works properly.
Created attachment 46573 [details] [review] Proposed gtk_tool_button_[gs]et_icon_name implementation A quick test revealed that it seems to work just fine. If neither a stock ID nor the icon-widget are set, the "icon-name" icon is used.
Committed the dnd functions with minor changes. 2005-05-18 Matthias Clasen <mclasen@redhat.com> * gtk/gtk.symbols: * gtk/gtkdnd.h: * gtk/gtkdnd.c (gtk_drag_source_set_icon_name) (gtk_drag_set_icon_name): New functions to support themed drag icons. (#116577, Christian Neumair)
Committed the toolbutton functions with minor changes. 2005-05-18 Matthias Clasen <mclasen@redhat.com> * gtk/gtk.symbols: * gtk/gtktoolbutton.h: * gtk/gtktoolbutton.c (gtk_tool_button_set_icon_name) (gtk_tool_button_get_icon_name): Support named icons in tool buttons by adding a icon-name property.