Re: Built in themed icons



On Sun, 2003-05-11 at 11:49, J. Ali Harlow wrote:
> 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?

I'm not too worried about divergence, but I'm not sure it is *useful*
... I think if there is a sensible policy of when we should scake 
or not scale we should just build that into GtkIconInfo. If you
want something else, all the pieces will be there.

If we did want that facility, I'd do it something like:

 gtk_icon_info_load (icon_info, size) 

and alllow size == -1 to mean "you decide based on the size I originally
passed in".

Regards,
                                              Owen





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