diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-11-30 18:32:01 -0500 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-11-30 18:32:01 -0500 |
commit | d300ddc5e49f14c42cf9fb1a897899fb65b91da9 (patch) | |
tree | 1f66a1a0f4aaca51cdc82a36f09771c739d77ad9 /gtk/gtkiconhelper.c | |
parent | e37c55aa3eeeec6860de01e937b332697eecc529 (diff) | |
download | gtk+-d300ddc5e49f14c42cf9fb1a897899fb65b91da9.tar.gz |
icon-helper: don't warn out when the icon size is GTK_ICON_SIZE_INVALID
We can call ensure_icon_size() for an empty image; don't warn out in
that case, but just return a zero width.
Diffstat (limited to 'gtk/gtkiconhelper.c')
-rw-r--r-- | gtk/gtkiconhelper.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c index 46724f9197..063b7a8505 100644 --- a/gtk/gtkiconhelper.c +++ b/gtk/gtkiconhelper.c @@ -128,8 +128,15 @@ ensure_icon_size (GtkIconHelper *self, self->priv->icon_size, &width, &height)) { - g_warning ("Invalid icon size %d\n", self->priv->icon_size); - width = height = 24; + if (self->priv->icon_size == GTK_ICON_SIZE_INVALID) + { + width = height = 0; + } + else + { + g_warning ("Invalid icon size %d\n", self->priv->icon_size); + width = height = 24; + } } *width_out = width; |