icons in computer menu without size hints

Bug #8343 reported by Jeff Waugh
8
Affects Status Importance Assigned to Milestone
gnome-panel (Ubuntu)
Fix Released
Medium
James Henstridge

Bug Description

This is most obvious with the Documents icon, but might affect the others. It
will become more of an issue when we're using SVG icons (and hinted PNG sizes
with them, if we do).

Revision history for this message
James Henstridge (jamesh) wrote :

Are there any particular file types that you've noticed this problem on? It
would help when checking out the problem (I assume this is with the Ubuntu icon
theme, right?)

I took a quick look through the code in the panel, and it looks like it should
scale down large images to the right size.

It looks like it isn't passing a size hint when loading the file, so SVG icons
will be rendered at their default size. If this size is smaller than the
desired size, then they won't be scaled up. Otherwise, it will be scaled down
(but this is slower than rendering at the desired size initially).

Revision history for this message
Jeff Waugh (jdub) wrote :

Because it's not using hints, the Documents icon is a large icon, scaled down.

Revision history for this message
James Henstridge (jamesh) wrote :

Created an attachment (id=171)
gnome-panel-pixbuf-loading.patch

Okay, here's a patch that changes all uses of gdk_pixbuf_new_from_file() to
gdk_pixbuf_new_from_file_at_size() in the gnome-panel code (including some
fixes to code cut-n-pasted from libegg). This should cause the SVG icons to be
rendered at an appropriate size.

This patch is against the upstream gnome-panel code. I've checked the Ubuntu
panel patches, and they don't explicitly load images (the icons in the Computer
menu are loaded using panel_make_menu_icon(), which I patch).

I think it is working, but it's a bit difficult to tell (I just need to render
the SVG small and compare it with a scaled rendered SVG).

Revision history for this message
James Henstridge (jamesh) wrote :

I just played around with the rsvg utility and ImageMagic, and it looks like the
panel is displaying the gnome-fs-directory.svg image (the one used for the
Documents item) rendered at 24x24 rather than at 160x160 (the size specified in
the SVG file, which would have been used by default) then scaled down to 24x24.

The difference isn't that big, but this change does make the icon look a bit
more crisp.

Revision history for this message
James Henstridge (jamesh) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Patch included in the new upload, thanks James

 gnome-panel (2.8.0-0ubuntu3) warty; urgency=low
 ....
   James Henstridge <email address hidden>
   * debian/patches/09_pixbuf-loading.patch:
     - lets backends like the SVG loader render an icon at the right size so
       we don't need to scale it down (Warty: #1587).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.