Bug 16378

Summary: Implement Icon for Gtk
Product: WebKit Reporter: Christian Dywan <christian>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major Keywords: Gtk
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Linux   
Attachments:
Description Flags
Implement Icon for Gtk
alp: review-
Use cairo, with Changelog and explanation
none
Updated patch alp: review+

Description Christian Dywan 2007-12-10 03:52:37 PST
When looking at the "file" control I noticed that the class Icon that is used to display a file icon is not implemented.
Comment 1 Christian Dywan 2007-12-10 03:55:33 PST
Created attachment 17818 [details]
Implement Icon for Gtk

This implementation creates a GdkPixbuf for the icon and probes the icon theme for an appropriate icon according to the icon naming specification or to gnome's icon names respectively.
Comment 2 Alp Toker 2007-12-10 05:37:58 PST
Comment on attachment 17818 [details]
Implement Icon for Gtk

I didn't check the icon name code yet, but the drawing should almost certainly be done with cairo and gdk_cairo_set_source_pixbuf() rather than gdk_draw_pixbuf() so that the drawing operation will integrate with the rest of the graphics backend.

A ChangeLog, particularly to explain lookupIconName() (which was non-obvious to me) would be helpful.

Thanks!
Comment 3 Christian Dywan 2007-12-11 03:46:50 PST
Created attachment 17843 [details]
Use cairo, with Changelog and explanation
Comment 4 Alp Toker 2007-12-15 09:04:48 PST
What site or test case can this patch be checked against?
Comment 5 Christian Dywan 2007-12-17 07:17:15 PST
Created attachment 17962 [details]
Updated patch

You can test the code by navigating to any website containing a "file" control. As soon as a file is chosen, an icon is displayed near the filename.
Comment 6 Alp Toker 2007-12-17 08:12:57 PST
Comment on attachment 17962 [details]
Updated patch

r=me

Will add the save/restore, m_icon initialization and style cleanups before landing.
Comment 7 Alp Toker 2007-12-17 08:20:04 PST
Landed in r28809.