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.
This commit is contained in:
parent
e37c55aa3e
commit
d300ddc5e4
@ -127,10 +127,17 @@ ensure_icon_size (GtkIconHelper *self,
|
|||||||
else if (!gtk_icon_size_lookup_for_settings (settings,
|
else if (!gtk_icon_size_lookup_for_settings (settings,
|
||||||
self->priv->icon_size,
|
self->priv->icon_size,
|
||||||
&width, &height))
|
&width, &height))
|
||||||
|
{
|
||||||
|
if (self->priv->icon_size == GTK_ICON_SIZE_INVALID)
|
||||||
|
{
|
||||||
|
width = height = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
g_warning ("Invalid icon size %d\n", self->priv->icon_size);
|
g_warning ("Invalid icon size %d\n", self->priv->icon_size);
|
||||||
width = height = 24;
|
width = height = 24;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*width_out = width;
|
*width_out = width;
|
||||||
*height_out = height;
|
*height_out = height;
|
||||||
|
Loading…
Reference in New Issue
Block a user