Bug 16378 - Implement Icon for Gtk
Summary: Implement Icon for Gtk
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Major
Assignee: Nobody
Keywords: Gtk
Depends on:
Reported: 2007-12-10 03:52 PST by Christian Dywan
Modified: 2007-12-17 08:20 PST (History)
0 users

See Also:

Implement Icon for Gtk (2.96 KB, patch)
2007-12-10 03:55 PST, Christian Dywan
alp: review-
Details | Formatted Diff | Diff
Use cairo, with Changelog and explanation (4.44 KB, patch)
2007-12-11 03:46 PST, Christian Dywan
no flags Details | Formatted Diff | Diff
Updated patch (4.35 KB, patch)
2007-12-17 07:17 PST, Christian Dywan
alp: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.

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


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.