diff options
author | Matthias Clasen <mclasen@redhat.com> | 2008-06-16 02:05:16 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-06-16 02:05:16 +0000 |
commit | 0fc1f3aeedfb264e780823477d30ab5f7be70745 (patch) | |
tree | 3182d8e0312b711c50ad4efcee76c2930f3f18cf /gtk/gtkimage.c | |
parent | bfe00f9b9bea56f105fc873d66f9865e552af5a2 (diff) | |
download | gtk+-0fc1f3aeedfb264e780823477d30ab5f7be70745.tar.gz |
When pixel-size is specified, use GTK_ICON_LOOKUP_FORCE_SIZE when loading
2008-06-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkimage.c: When pixel-size is specified, use
GTK_ICON_LOOKUP_FORCE_SIZE when loading themed icons.
svn path=/trunk/; revision=20394
Diffstat (limited to 'gtk/gtkimage.c')
-rw-r--r-- | gtk/gtkimage.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index 07ce08fb58..4ef4847e5d 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -1528,6 +1528,7 @@ ensure_pixbuf_for_icon_name (GtkImage *image) GtkSettings *settings; gint width, height; gint *sizes, *s, dist; + GtkIconLookupFlags flags; GError *error = NULL; g_return_if_fail (image->storage_type == GTK_IMAGE_ICON_NAME); @@ -1536,11 +1537,13 @@ ensure_pixbuf_for_icon_name (GtkImage *image) screen = gtk_widget_get_screen (GTK_WIDGET (image)); icon_theme = gtk_icon_theme_get_for_screen (screen); settings = gtk_settings_get_for_screen (screen); + flags = GTK_ICON_LOOKUP_USE_BUILTIN; if (image->data.name.pixbuf == NULL) { if (priv->pixel_size != -1) { width = height = priv->pixel_size; + flags |= GTK_ICON_LOOKUP_FORCE_SIZE; } else if (!gtk_icon_size_lookup_for_settings (settings, image->icon_size, @@ -1587,7 +1590,7 @@ ensure_pixbuf_for_icon_name (GtkImage *image) image->data.name.pixbuf = gtk_icon_theme_load_icon (icon_theme, image->data.name.icon_name, - MIN (width, height), 0, &error); + MIN (width, height), flags, &error); if (image->data.name.pixbuf == NULL) { g_error_free (error); @@ -1608,8 +1611,9 @@ ensure_pixbuf_for_gicon (GtkImage *image) GtkIconTheme *icon_theme; GtkSettings *settings; gint width, height; - GError *error = NULL; GtkIconInfo *info; + GtkIconLookupFlags flags; + GError *error = NULL; g_return_if_fail (image->storage_type == GTK_IMAGE_GICON); @@ -1617,11 +1621,13 @@ ensure_pixbuf_for_gicon (GtkImage *image) screen = gtk_widget_get_screen (GTK_WIDGET (image)); icon_theme = gtk_icon_theme_get_for_screen (screen); settings = gtk_settings_get_for_screen (screen); + flags = GTK_ICON_LOOKUP_USE_BUILTIN; if (image->data.gicon.pixbuf == NULL) { if (priv->pixel_size != -1) { width = height = priv->pixel_size; + flags |= GTK_ICON_LOOKUP_FORCE_SIZE; } else if (!gtk_icon_size_lookup_for_settings (settings, image->icon_size, @@ -1638,7 +1644,7 @@ ensure_pixbuf_for_gicon (GtkImage *image) info = gtk_icon_theme_lookup_by_gicon (icon_theme, image->data.gicon.icon, - MIN (width, height), 0); + MIN (width, height), flags); image->data.gicon.pixbuf = gtk_icon_info_load_icon (info, &error); if (image->data.gicon.pixbuf == NULL) { |