After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 677567 - icontheme clips bigger symbolic icons to 16x16
icontheme clips bigger symbolic icons to 16x16
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-06-06 16:33 UTC by Carlos Garnacho
Modified: 2012-07-13 13:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (3.32 KB, patch)
2012-06-06 16:34 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2012-06-06 16:33:10 UTC
At the time of creating a symbolic icon for a given colorset, GtkIconTheme creates an embedder piece of SVG to override the colors, also forcing a size of 16x16 on it. This results in icons being clipped (rather than resized) if the theme being used offers symbolic icons at bigger default sizes.

I'm attaching a patch to have that code use the original icon size when overriding colors.
Comment 1 Carlos Garnacho 2012-06-06 16:34:24 UTC
Created attachment 215758 [details] [review]
patch
Comment 2 Cosimo Cecchi 2012-07-12 17:04:30 UTC
Review of attachment 215758 [details] [review]:

::: gtk/gtkicontheme.c
@@ +3220,3 @@
                       "     xmlns:xi=\"http://www.w3.org/2001/XInclude\"\n"
+                      "     width=\"", width, "\"\n"
+                      "     height=\"", height, "\">\n"

What happens if you remove the width and height parameters from the CSS file completely instead?
Would that pick up the size of the original image without requiring us to force it this way?

Which themes use symbolic icons whose original size is not 16x16?
Comment 3 Carlos Garnacho 2012-07-12 18:26:16 UTC
(In reply to comment #2)
> Review of attachment 215758 [details] [review]:
> What happens if you remove the width and height parameters from the CSS file
> completely instead?
> Would that pick up the size of the original image without requiring us to force
> it this way?

I think the width/height are expected in the root <svg> tag, removing those just shows the "image missing" icon with no further error though

> 
> Which themes use symbolic icons whose original size is not 16x16?

I first thought I stumbled with this bug on the Sugar theme, but it turned out to be bug #678087. Still, this theme has odd-sized icons that could hit this if symbolic icons are used more extensively, and the symbolic icon spec doesn't mention an icon size limit.
Comment 4 Cosimo Cecchi 2012-07-12 18:55:52 UTC
Review of attachment 215758 [details] [review]:

Sounds fine to me then, except for the following comment

::: gtk/gtkicontheme.c
@@ +3205,3 @@
+      if (!pixbuf)
+        return FALSE;
+

This should return NULL
Comment 5 Carlos Garnacho 2012-07-13 13:02:25 UTC
(In reply to comment #4)
> ::: gtk/gtkicontheme.c
> @@ +3205,3 @@
> +      if (!pixbuf)
> +        return FALSE;
> +
> 
> This should return NULL

I changed that and pushed, thanks!