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 116577 - Support named icons at appropriate places in API
Support named icons at appropriate places in API
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.6.x
Other All
: Normal normal
: Medium API
Assigned To: gtk-bugs
gtk-bugs
Depends on: 155688 156378 165777
Blocks:
 
 
Reported: 2003-07-02 22:59 UTC by Owen Taylor
Modified: 2005-05-18 05:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed gtk_drag_(source_)set_icon_name() implementation (against HEAD) (4.72 KB, patch)
2005-05-17 16:24 UTC, Christian Neumair
none Details | Review
gtk_drag_(source_)set_icon_name() implementation, attempt 2 (4.59 KB, patch)
2005-05-17 21:19 UTC, Christian Neumair
committed Details | Review
Proposed gtk_tool_button_[gs]et_icon_name implementation (6.72 KB, patch)
2005-05-17 22:05 UTC, Christian Neumair
committed Details | Review

Description Owen Taylor 2003-07-02 22:59:49 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)
Comment 1 Sean Middleditch 2003-07-03 19:34:52 UTC
I think you meant bug http://bugzilla.gnome.org/show_bug.cgi?id=92346
Comment 2 Owen Taylor 2004-02-26 19:41:55 UTC
Will have to wait for 2.6.
Comment 3 Matthias Clasen 2004-12-18 04:57:02 UTC
gtk_window_set_icon_name()
gtk_window_set_default_icon_name() 
gtk_image_set_icon_name()

are already done 
Comment 4 Christian Neumair 2005-05-17 16:21:55 UTC
Still an issue. Note that I'm working on gtk_drag_source_set_icon_name() and
gtk_drag_set_icon_name().
Comment 5 Christian Neumair 2005-05-17 16:24:59 UTC
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.
Comment 6 Matthias Clasen 2005-05-17 19:36:12 UTC
 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.
Comment 7 Christian Neumair 2005-05-17 21:19:11 UTC
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.
Comment 8 Christian Neumair 2005-05-17 22:05:17 UTC
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.
Comment 9 Matthias Clasen 2005-05-18 05:24:07 UTC
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)
Comment 10 Matthias Clasen 2005-05-18 05:39:24 UTC
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.