Re: Built in themed icons



On 2003.05.11 13:21 Owen Taylor wrote:

That being said, this is a meant as a raw 'look up the icon source'
call, and the original API has a separate:

 gtk_icon_theme_load_icon()

that actually loads filenames and scaled as appropriate. I suppose
we could add a load() onto GtkIconInfo * as well, though:

 GtkIconInfo *info = gtk_icon_theme_lookup_icon (theme, name, size, 0);
 GdkPixbuf *pixbuf = gtk_icon_info_load_icon (info);
 gdk_icon_info_free (info);

Is clumsy enough that a convenience function is likely warranted.

Yes. Since we've gone this far, how about the facility to specify
a final size after the best size is known so that an application
might have something like:

GtkIconInfo *info = gtk_icon_theme_lookup_icon (theme, name, size, 0);
if (gtk_icon_info_get_base_size(icon) < size &&
  gtk_icon_info_get_base_size(icon) > size - 2)
	gtk_icon_info_set_size(icon, gtk_icon_info_get_base_size());
GdkPixbuf *pixbuf = gtk_icon_info_load_icon (info);
gdk_icon_info_free (info);

if it wanted to determine its own rules for when scaling should be
applied, or would that simply contribute to unwanted application
divergence?

--
Ali Harlow                              Email: ali avrc city ac uk
Research programmer                     Tel:   (020) 7040 4348
Applied Vision Research Centre          Intl: +44 20 7040 4348
City University                         Fax:   (020) 7040 5515
London                                  Intl: +44 20 7040 5515



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]