[Webkit-unassigned] [Bug 50624] [GTK] Don't use a fixed size for search field icons

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 21 01:31:17 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=50624





--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-01-21 01:31:17 PST ---
(In reply to comment #2)
> (From update of attachment 79580 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=79580&action=review
> 
> > Source/WebCore/platform/gtk/RenderThemeGtk.cpp:-261
> > -    // We also add one pixel here to ensure that the y coordinate is rounded up for box heights
> > -    // that are even, which looks in relation to the box text.
> 
> I believe kov asked me to add this comment specifically so we probably shouldn't delete it. It explains the "+ 1" below. It should say "looks good" though I think.

This is a mistake I didn't want to remove that, sorry. 

> > Source/WebCore/platform/gtk/RenderThemeGtk.cpp:276
> >      GRefPtr<GdkPixbuf> icon = getStockIcon(GTK_TYPE_ENTRY, GTK_STOCK_FIND,
> >                                             gtkTextDirection(renderObject->style()->direction()),
> >                                             gtkIconState(this, renderObject), GTK_ICON_SIZE_MENU);
> 
> Wouldn't it either make sense to either pass the actual size here 

Gtk expects a GtkIconSize which is actually an integer, even if we register new icon sizes, gtk_icon_set_render_icon_pixbuf() doesn't guarantee that the returned pixbuf will have the pixel size of the given icon size, if it finds a builtin pixbuf in the theme close to the given size, it will be returned. This is because GtkIconFactory uses gtk_icon_theme_choose_icon() with only the flag GTK_ICON_LOOKUP_USE_BUILTIN, it doesn't use GTK_ICON_LOOKUP_FORCE_SIZE. In this case we want to make sure the pixbuf has the pixel size we want, so we have to scale it. 

> or get the largest possible size and scale down?

The largest possible size is GTK_ICON_SIZE_MENU so we are indeed doing so. We define GTK_ICON_SIZE_MENU as the max size in adjustSearchField methods, in most of the cases this is what we want and the returned pixbuf, which is cached by gtk, is valid, and only in a few cases we need to sacle it down.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list