]> Pileus Git - ~andy/gtk/commitdiff
When pixel-size is specified, use GTK_ICON_LOOKUP_FORCE_SIZE when loading
authorMatthias Clasen <mclasen@redhat.com>
Mon, 16 Jun 2008 02:05:16 +0000 (02:05 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 16 Jun 2008 02:05:16 +0000 (02:05 +0000)
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

ChangeLog
gtk/gtkimage.c

index ce37ce0e6fe9d7696a21c46fa20441cc880e28f9..f9c199df8ac74aa9375e105770cd63643b3939ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
 2008-06-15  Carlos Garnacho  <carlos@imendio.com>
 
        * gtk/gtkfilechooser.c (gtk_file_chooser_get_filename): Return full 
index 07ce08fb580be25a232c587c81edf4341e2e4ff8..4ef4847e5df4c4c373b2195557c6099e28cc4cc8 100644 (file)
@@ -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)
        {