[PATCH] Use GTK+ menu icon size instead of NAUTILUS_ICON_SIZE_FOR_MENUS



From bug 167107 [1]:

"For consistency with gtk+ fileselector (see bug #165770), the sidebar
should use the 16x16 (GTK_ICON_SIZE_MENU) versions of the same icons."

Note that the same applies for the Places menu, the treeview and some
other locations.
Proposed patches attached.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=167107

-- 
Christian Neumair <chris gnome-de org>
? libnautilus-private/.nautilus-icon-factory.h.swp
? libnautilus-private/gmon.out
Index: libnautilus-private/nautilus-bookmark.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-bookmark.c,v
retrieving revision 1.63
diff -u -p -r1.63 nautilus-bookmark.c
--- libnautilus-private/nautilus-bookmark.c	16 May 2005 15:11:31 -0000	1.63
+++ libnautilus-private/nautilus-bookmark.c	22 May 2005 20:33:41 -0000
@@ -205,8 +205,7 @@ nautilus_bookmark_get_name (NautilusBook
 
 GdkPixbuf *	    
 nautilus_bookmark_get_pixbuf (NautilusBookmark *bookmark,
-			      guint icon_size,
-			      gboolean optimize_for_anti_aliasing)
+			      GtkIconSize icon_size)
 {
 	GdkPixbuf *result;
 	char *icon;
@@ -218,7 +217,7 @@ nautilus_bookmark_get_pixbuf (NautilusBo
 		return NULL;
 	}
 
-	result = nautilus_icon_factory_get_pixbuf_for_icon_force_size
+	result = nautilus_icon_factory_get_pixbuf_for_icon_with_stock_size
 		(icon, NULL,
 		 icon_size, NULL, NULL,
 		 TRUE, NULL);
@@ -483,7 +482,7 @@ create_image_widget_for_bookmark (Nautil
 	GdkPixbuf *pixbuf;
 	GtkWidget *widget;
 
-	pixbuf = nautilus_bookmark_get_pixbuf (bookmark, NAUTILUS_ICON_SIZE_FOR_MENUS, FALSE);
+	pixbuf = nautilus_bookmark_get_pixbuf (bookmark, GTK_ICON_SIZE_MENU);
 	if (pixbuf == NULL) {
 		return NULL;
 	}
Index: libnautilus-private/nautilus-bookmark.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-bookmark.h,v
retrieving revision 1.21
diff -u -p -r1.21 nautilus-bookmark.h
--- libnautilus-private/nautilus-bookmark.h	10 Mar 2003 16:45:39 -0000	1.21
+++ libnautilus-private/nautilus-bookmark.h	22 May 2005 20:33:41 -0000
@@ -25,6 +25,7 @@
 #ifndef NAUTILUS_BOOKMARK_H
 #define NAUTILUS_BOOKMARK_H
 
+#include <gtk/gtkenums.h>
 #include <gtk/gtkwidget.h>
 #include <libnautilus-private/nautilus-icon-factory.h>
 
@@ -91,8 +92,7 @@ char *                nautilus_bookmark_
 
 /* Helper functions for displaying bookmarks */
 GdkPixbuf *           nautilus_bookmark_get_pixbuf             (NautilusBookmark      *bookmark,
-								guint                  icon_size,
-								gboolean               optimize_for_anti_aliasing);
+								GtkIconSize            icon_size);
 GtkWidget *           nautilus_bookmark_menu_item_new          (NautilusBookmark      *bookmark);
 
 #endif /* NAUTILUS_BOOKMARK_H */
Index: libnautilus-private/nautilus-icon-container.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.385
diff -u -p -r1.385 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	2 May 2005 20:50:06 -0000	1.385
+++ libnautilus-private/nautilus-icon-container.c	22 May 2005 20:33:44 -0000
@@ -5016,7 +5016,7 @@ nautilus_icon_container_update_icon (Nau
 		 icon_size,
 		 &attach_points,
 		 &embedded_text_rect,
-		 TRUE, NULL);
+		 FALSE, TRUE, NULL);
 	
 	g_free (icon_name);
 
@@ -5038,7 +5038,7 @@ nautilus_icon_container_update_icon (Nau
 			 MIN (icon_size, MAXIMUM_EMBLEM_SIZE),
 			 NULL,
 			 NULL,
-			 FALSE, NULL);
+			 FALSE, FALSE, NULL);
 		if (emblem_pixbuf != NULL) {
 			emblem_pixbufs = g_list_prepend
 				(emblem_pixbufs, emblem_pixbuf);
Index: libnautilus-private/nautilus-icon-factory.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-factory.c,v
retrieving revision 1.314
diff -u -p -r1.314 nautilus-icon-factory.c
--- libnautilus-private/nautilus-icon-factory.c	21 May 2005 16:13:58 -0000	1.314
+++ libnautilus-private/nautilus-icon-factory.c	22 May 2005 20:33:45 -0000
@@ -48,6 +48,7 @@
 #include <eel/eel-vfs-extensions.h>
 #include <gtk/gtksettings.h>
 #include <gtk/gtksignal.h>
+#include <gtk/gtkiconfactory.h>
 #include <gtk/gtkicontheme.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnome/gnome-util.h>
@@ -800,6 +801,16 @@ should_show_thumbnail (NautilusFile *fil
 	return FALSE;
 }
 
+static gint
+gtk_icon_size_to_nominal_size (GtkIconSize icon_size)
+{
+	gint ret;
+
+	g_assert (gtk_icon_size_lookup (icon_size, &ret, NULL));
+
+	return ret;
+}
+
 /* key routine to get the icon for a file */
 char *
 nautilus_icon_factory_get_icon_for_file (NautilusFile *file, gboolean embedd_text)
@@ -982,9 +993,6 @@ nautilus_icon_factory_get_larger_icon_si
 	if (size < NAUTILUS_ICON_SIZE_SMALLEST) {
 		return NAUTILUS_ICON_SIZE_SMALLEST;
 	}
-	if (size < NAUTILUS_ICON_SIZE_FOR_MENUS) {
-		return NAUTILUS_ICON_SIZE_FOR_MENUS;
-	}
 	if (size < NAUTILUS_ICON_SIZE_SMALLER) {
 		return NAUTILUS_ICON_SIZE_SMALLER;
 	}
@@ -1024,9 +1032,6 @@ nautilus_icon_factory_get_smaller_icon_s
 	if (size > NAUTILUS_ICON_SIZE_SMALLER) {
 		return NAUTILUS_ICON_SIZE_SMALLER;
 	}
-	if (size > NAUTILUS_ICON_SIZE_FOR_MENUS) {
-		return NAUTILUS_ICON_SIZE_FOR_MENUS;
-	}
 	return NAUTILUS_ICON_SIZE_SMALLEST;
 }
 
@@ -1365,15 +1370,15 @@ get_icon_from_cache (const char *icon,
         return cached_icon;
 }
 
-static GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_icon_internal (const char                  *icon,
-						    const char                  *modifier,
-						    guint                        nominal_size,
-						    gboolean                     force_size,
-						    NautilusEmblemAttachPoints  *attach_points,
-						    GdkRectangle                *embedded_text_rect,
-						    gboolean                     wants_default,
-						    char                       **display_name)
+GdkPixbuf *
+nautilus_icon_factory_get_pixbuf_for_icon (const char                  *icon,
+					   const char                  *modifier,
+					   guint                        nominal_size,
+					   NautilusEmblemAttachPoints  *attach_points,
+					   GdkRectangle                *embedded_text_rect,
+					   gboolean                     force_size,
+					   gboolean                     wants_default,
+					   char                       **display_name)
 {
 	NautilusIconFactory *factory;
 	CacheIcon *cached_icon;
@@ -1426,35 +1431,23 @@ nautilus_icon_factory_get_pixbuf_for_ico
 	return pixbuf;
 }
 
-GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_icon (const char                  *icon,
-					   const char                  *modifier,
-					   guint                        nominal_size,
-					   NautilusEmblemAttachPoints  *attach_points,
-					   GdkRectangle                *embedded_text_rect,
-					   gboolean                     wants_default,
-					   char                       **display_name)
-{
-	return nautilus_icon_factory_get_pixbuf_for_icon_internal (icon, modifier, nominal_size, FALSE,
-								   attach_points, embedded_text_rect,
-								   wants_default, display_name);
-}
 
 GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_icon_force_size (const char                  *icon,
-						      const char                  *modifier,
-						      guint                        nominal_size,
-						      NautilusEmblemAttachPoints  *attach_points,
-						      GdkRectangle                *embedded_text_rect,
-						      gboolean                     wants_default,
-						      char                       **display_name)
-{
-	return nautilus_icon_factory_get_pixbuf_for_icon_internal (icon, modifier, nominal_size, TRUE,
-								   attach_points, embedded_text_rect,
-								   wants_default, display_name);
+nautilus_icon_factory_get_pixbuf_for_icon_with_stock_size (const char                  *icon,
+							   const char                  *modifier,
+							   GtkIconSize                  stock_size,
+							   NautilusEmblemAttachPoints  *attach_points,
+							   GdkRectangle                *embedded_text_rect,
+							   gboolean                     wants_default,
+							   char                       **display_name)
+{
+	return nautilus_icon_factory_get_pixbuf_for_icon (icon, modifier,
+							  gtk_icon_size_to_nominal_size (stock_size),
+							  attach_points, embedded_text_rect,
+							  TRUE /* force_size*/, wants_default,
+							  display_name);
 }
 
-
 static guint
 cache_key_hash (gconstpointer p)
 {
@@ -1526,11 +1519,11 @@ nautilus_get_relative_icon_size_for_zoom
 /* Convenience cover for nautilus_icon_factory_get_icon_for_file
  * and nautilus_icon_factory_get_pixbuf_for_icon.
  */
-static GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_file_internal (NautilusFile *file,
-						    const char *modifier,
-						    guint size_in_pixels,
-						    gboolean force_size)
+GdkPixbuf *
+nautilus_icon_factory_get_pixbuf_for_file (NautilusFile *file,
+					   const char *modifier,
+					   guint size_in_pixels,
+					   gboolean force_size)
 {
 	char *icon;
 	GdkPixbuf *pixbuf;
@@ -1542,11 +1535,11 @@ nautilus_icon_factory_get_pixbuf_for_fil
 		return NULL;
 	}
 
-	pixbuf = nautilus_icon_factory_get_pixbuf_for_icon_internal (icon, modifier,
-								     size_in_pixels,
-								     force_size,
-								     NULL, NULL,
-								     TRUE, NULL);
+	pixbuf = nautilus_icon_factory_get_pixbuf_for_icon (icon, modifier,
+							    size_in_pixels,
+							    NULL, NULL,
+							    force_size,
+							    TRUE, NULL);
 	
 	g_free (icon);
 
@@ -1554,25 +1547,14 @@ nautilus_icon_factory_get_pixbuf_for_fil
 }
 
 GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_file (NautilusFile *file,
-					   const char *modifier,
-					   guint size_in_pixels)
-{
-	return nautilus_icon_factory_get_pixbuf_for_file_internal (file,
-								   modifier,
-								   size_in_pixels,
-								   FALSE);
-}
+nautilus_icon_factory_get_pixbuf_for_file_with_stock_size (NautilusFile *file,
+							   const char   *modifier,
+							   GtkIconSize   stock_size)
+{
+	return nautilus_icon_factory_get_pixbuf_for_file (file, modifier,
+							  gtk_icon_size_to_nominal_size (stock_size),
+							  TRUE); /* force_size */
 
-GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_file_force_size (NautilusFile *file,
-						      const char *modifier,
-						      guint size_in_pixels)
-{
-	return nautilus_icon_factory_get_pixbuf_for_file_internal (file,
-								   modifier,
-								   size_in_pixels,
-								   TRUE);
 }
 
 /* Convenience routine for getting a pixbuf from an icon name. */
@@ -1583,12 +1565,25 @@ nautilus_icon_factory_get_pixbuf_from_na
 					    gboolean force_size,
 					    char **display_name)
 {
-	return nautilus_icon_factory_get_pixbuf_for_icon_internal (icon_name, modifier,
-								   size_in_pixels, force_size,
-								   NULL, NULL,
-								   TRUE, display_name);
+	return nautilus_icon_factory_get_pixbuf_for_icon (icon_name, modifier,
+							  size_in_pixels,
+							  NULL, NULL,
+							  force_size, TRUE,
+							  display_name);
 }
-									  
+
+GdkPixbuf *
+nautilus_icon_factory_get_pixbuf_from_name_with_stock_size (const char *icon_name,
+							    const char *modifier,
+							    GtkIconSize stock_size,
+							    char **display_name)
+{
+	return nautilus_icon_factory_get_pixbuf_from_name (icon_name, modifier,
+							   gtk_icon_size_to_nominal_size (stock_size),
+							   TRUE, display_name);
+}
+
+
 GdkPixbuf *
 nautilus_icon_factory_get_thumbnail_frame (void)
 {
Index: libnautilus-private/nautilus-icon-factory.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-factory.h,v
retrieving revision 1.52
diff -u -p -r1.52 nautilus-icon-factory.h
--- libnautilus-private/nautilus-icon-factory.h	21 May 2005 16:13:59 -0000	1.52
+++ libnautilus-private/nautilus-icon-factory.h	22 May 2005 20:33:45 -0000
@@ -77,12 +77,6 @@ typedef enum {
 /* Maximum size of an icon that the icon factory will ever produce */
 #define NAUTILUS_ICON_MAXIMUM_SIZE     320
 
-/* Icon size to use for menus. NAUTILUS_ICON_SIZE_SMALLEST
- * is a little too small and NAUTILUS_ICON_SIZE_SMALLER is
- * a little too big.
- */
-#define NAUTILUS_ICON_SIZE_FOR_MENUS	20
-
 /* here's a structure to hold the emblem attach points */
 
 #define MAX_ATTACH_POINTS 12
@@ -133,25 +127,29 @@ GdkPixbuf *nautilus_icon_factory_get_pix
 								 guint                        nominal_size,
 								 NautilusEmblemAttachPoints  *attach_points,
 								 GdkRectangle                *embedded_text_rect,
+								 gboolean                     force_size,
 								 gboolean                     wants_default,
 								 char                       **display_name);
-GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_icon_force_size (const char                  *icon,
-								 const char                  *modifier,
-								 guint                        nominal_size,
-								 NautilusEmblemAttachPoints  *attach_points,
-								 GdkRectangle                *embedded_text_rect,
-								 gboolean                     wants_default,
-								 char                       **display_name);
+GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_icon_with_stock_size (const char                  *icon,
+								      const char                  *modifier,
+								      GtkIconSize                  stock_size,
+								      NautilusEmblemAttachPoints  *attach_points,
+								      GdkRectangle                *embedded_text_rect,
+								      gboolean                     wants_default,
+								      char                       **display_name);
+
 									  
 /* Convenience functions for the common case where you want to choose
  * and render the icon into a pixbuf all at once.
  */
 GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_file            (NautilusFile *file,
 								 const char   *modifer,
-								 guint         size_in_pixels);
-GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_file_force_size (NautilusFile *file,
-								 const char   *modifier,
-								 guint         size_in_pixels);
+								 guint         size_in_pixels,
+								 gboolean      force_size);
+GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_file_with_stock_size (NautilusFile *file,
+								      const char   *modifier,
+								      GtkIconSize   stock_size);
+
 
 /* Convenience routine for getting a pixbuf from an icon name
  */
@@ -160,6 +158,10 @@ GdkPixbuf *           nautilus_icon_fact
 									  guint                        size_in_pixels,
 									  gboolean                     force_size,
 									  char                       **display_name);
+GdkPixbuf *           nautilus_icon_factory_get_pixbuf_from_name_with_stock_size (const char          *icon_name,
+										  const char          *modifer,
+										  GtkIconSize          stock_size,
+										  char               **display_name);
 
 GtkIconTheme *         nautilus_icon_factory_get_icon_theme        (void);
 GnomeThumbnailFactory *nautilus_icon_factory_get_thumbnail_factory (void);
Index: libnautilus-private/nautilus-ui-utilities.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-ui-utilities.c,v
retrieving revision 1.3
diff -u -p -r1.3 nautilus-ui-utilities.c
--- libnautilus-private/nautilus-ui-utilities.c	29 Nov 2004 16:39:31 -0000	1.3
+++ libnautilus-private/nautilus-ui-utilities.c	22 May 2005 20:33:45 -0000
@@ -26,6 +26,7 @@
 #include "nautilus-ui-utilities.h"
 #include "nautilus-icon-factory.h"
 
+#include <gtk/gtkenums.h>
 #include <eel/eel-debug.h>
 
 void
@@ -135,10 +136,10 @@ nautilus_action_from_menu_item (Nautilus
 	/* TODO: This should really use themed icons, but that
 	   doesn't work here yet */
 	if (icon != NULL) {
-		pixbuf = nautilus_icon_factory_get_pixbuf_from_name 
+		pixbuf = nautilus_icon_factory_get_pixbuf_from_name_with_stock_size
 			(icon,
 			 NULL,
-			 NAUTILUS_ICON_SIZE_FOR_MENUS, TRUE,
+			 GTK_ICON_SIZE_MENU,
 			 NULL);
 		if (pixbuf != NULL) {
 			g_object_set_data_full (G_OBJECT (action), "menu-icon",
Index: src/nautilus-bookmarks-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-bookmarks-window.c,v
retrieving revision 1.84
diff -u -p -r1.84 nautilus-bookmarks-window.c
--- src/nautilus-bookmarks-window.c	23 Jun 2005 08:27:28 -0000	1.84
+++ src/nautilus-bookmarks-window.c	27 Jul 2005 12:35:24 -0000
@@ -35,6 +35,7 @@
 #include <eel/eel-gnome-extensions.h>
 #include <libnautilus-private/nautilus-icon-factory.h>
 #include <libnautilus-private/nautilus-undo-signal-handlers.h>
+#include <gtk/gtkenums.h>
 #include <gtk/gtkhbbox.h>
 #include <gnome.h>
 #include <libgnomeui/gnome-help.h>
@@ -935,9 +936,7 @@ repopulate (void)
 
 		bookmark = nautilus_bookmark_list_item_at (bookmarks, index);
 		bookmark_name = nautilus_bookmark_get_name (bookmark);
-		bookmark_pixbuf = nautilus_bookmark_get_pixbuf (bookmark,
-								NAUTILUS_ICON_SIZE_SMALLER,
-								TRUE);
+		bookmark_pixbuf = nautilus_bookmark_get_pixbuf (bookmark, GTK_ICON_SIZE_MENU);
 		
 		gtk_list_store_append (store, &iter);
 		gtk_list_store_set (store, &iter, 
Index: src/nautilus-history-sidebar.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-history-sidebar.c,v
retrieving revision 1.3
diff -u -p -r1.3 nautilus-history-sidebar.c
--- src/nautilus-history-sidebar.c	28 Jun 2005 12:54:45 -0000	1.3
+++ src/nautilus-history-sidebar.c	27 Jul 2005 12:35:25 -0000
@@ -33,6 +33,7 @@
 #include <eel/eel-preferences.h>
 #include <gtk/gtkcellrendererpixbuf.h>
 #include <gtk/gtkcellrenderertext.h>
+#include <gtk/gtkenums.h>
 #include <gtk/gtkliststore.h>
 #include <gtk/gtktreemodel.h>
 #include <gtk/gtktreeselection.h>
@@ -101,7 +102,7 @@ update_history (NautilusHistorySidebar *
 	for (l = history; l != NULL; l = l->next) {
 		bookmark = nautilus_bookmark_copy (l->data);
 
-		pixbuf = nautilus_bookmark_get_pixbuf (bookmark, NAUTILUS_ICON_SIZE_FOR_MENUS, FALSE);
+		pixbuf = nautilus_bookmark_get_pixbuf (bookmark, GTK_ICON_SIZE_MENU);
 		name = nautilus_bookmark_get_name (bookmark);
 		gtk_list_store_append (store, &iter);
 		gtk_list_store_set (store, &iter,
Index: src/nautilus-places-sidebar.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-places-sidebar.c,v
retrieving revision 1.5
diff -u -p -r1.5 nautilus-places-sidebar.c
--- src/nautilus-places-sidebar.c	11 Jul 2005 10:12:46 -0000	1.5
+++ src/nautilus-places-sidebar.c	27 Jul 2005 12:35:26 -0000
@@ -112,7 +112,7 @@ add_place (GtkListStore *store, PlaceTyp
 	GdkPixbuf            *pixbuf;
 	GtkTreeIter           iter;
 
-	pixbuf = nautilus_icon_factory_get_pixbuf_from_name (icon, NULL, NAUTILUS_ICON_SIZE_FOR_MENUS, TRUE, NULL);
+	pixbuf = nautilus_icon_factory_get_pixbuf_from_name_with_stock_size (icon, NULL, GTK_ICON_SIZE_MENU, NULL);
 	gtk_list_store_append (store, &iter);
 	gtk_list_store_set (store, &iter,
 			    PLACES_SIDEBAR_COLUMN_ICON, pixbuf,
Index: src/nautilus-sidebar-title.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-sidebar-title.c,v
retrieving revision 1.152
diff -u -p -r1.152 nautilus-sidebar-title.c
--- src/nautilus-sidebar-title.c	15 Jul 2005 13:47:53 -0000	1.152
+++ src/nautilus-sidebar-title.c	27 Jul 2005 12:35:27 -0000
@@ -320,7 +320,8 @@ update_icon (NautilusSidebarTitle *sideb
 	} else if (nautilus_icon_factory_is_icon_ready_for_file (sidebar_title->details->file)) {
 		pixbuf = nautilus_icon_factory_get_pixbuf_for_file (sidebar_title->details->file,
 								    "accept",
-								    sidebar_title->details->best_icon_size);
+								    sidebar_title->details->best_icon_size,
+								    FALSE);
 	} else if (sidebar_title->details->determined_icon) {
 		/* We used to know the icon for this file, but now the file says it isn't
 		 * ready. This means that some file info has been invalidated, which
@@ -509,7 +510,7 @@ update_emblems (NautilusSidebarTitle *si
 			(p->data, NULL,
 			 NAUTILUS_ICON_SIZE_STANDARD,
 			 NULL, NULL,
-			 FALSE, NULL);
+			 FALSE, FALSE, NULL);
 		if (pixbuf != NULL) {
 			add_emblem (sidebar_title, pixbuf);
 			g_object_unref (pixbuf);
Index: src/nautilus-spatial-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-spatial-window.c,v
retrieving revision 1.450
diff -u -p -r1.450 nautilus-spatial-window.c
--- src/nautilus-spatial-window.c	23 Jul 2005 17:41:04 -0000	1.450
+++ src/nautilus-spatial-window.c	27 Jul 2005 12:35:31 -0000
@@ -600,7 +600,7 @@ location_button_drag_begin_callback (Gtk
 	GdkPixbuf *pixbuf;
 
 	pixbuf = nautilus_icon_factory_get_pixbuf_for_file (NAUTILUS_WINDOW (window)->details->viewed_file,
-							    "open", get_dnd_icon_size (window));
+							    "open", get_dnd_icon_size (window), FALSE);
 
 	gtk_drag_set_icon_pixbuf (context, pixbuf, 0, 0);
 
Index: src/nautilus-window-menus.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-menus.c,v
retrieving revision 1.287
diff -u -p -r1.287 nautilus-window-menus.c
--- src/nautilus-window-menus.c	6 Jul 2005 12:18:28 -0000	1.287
+++ src/nautilus-window-menus.c	27 Jul 2005 12:35:31 -0000
@@ -50,6 +50,7 @@
 #include <libxml/parser.h>
 #include <gtk/gtkmain.h>
 #include <gtk/gtkaboutdialog.h>
+#include <gtk/gtkenums.h>
 #include <libgnome/gnome-help.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnome/gnome-util.h>
@@ -168,7 +169,7 @@ nautilus_menus_append_bookmark_to_menu (
 	g_free (truncated_name);
 
 	/* Create menu item with pixbuf */
-	pixbuf = nautilus_bookmark_get_pixbuf (bookmark, NAUTILUS_ICON_SIZE_FOR_MENUS, FALSE);
+	pixbuf = nautilus_bookmark_get_pixbuf (bookmark, GTK_ICON_SIZE_MENU);
 
 	action_name = g_strdup_printf ("bookmark_%s_%d", parent_id, index_in_parent);
 
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.702
diff -u -p -r1.702 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	23 Jul 2005 17:47:14 -0000	1.702
+++ src/file-manager/fm-directory-view.c	27 Jul 2005 12:35:33 -0000
@@ -61,6 +61,7 @@
 #include <gtk/gtkhbox.h>
 #include <gtk/gtktoggleaction.h>
 #include <gtk/gtkentry.h>
+#include <gtk/gtkenums.h>
 #include <gtk/gtkbindings.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnome/gnome-util.h>
@@ -4337,11 +4338,8 @@ add_extension_action_for_files (FMDirect
 	/* TODO: This should really use themed icons, but that
 	   doesn't work here yet */
 	if (icon != NULL) {
-		pixbuf = nautilus_icon_factory_get_pixbuf_from_name 
-			(icon,
-			 NULL,
-			 NAUTILUS_ICON_SIZE_FOR_MENUS, TRUE,
-			 NULL);
+		pixbuf = nautilus_icon_factory_get_pixbuf_from_name_with_stock_size
+			(icon, NULL, GTK_ICON_SIZE_MENU, NULL);
 		if (pixbuf != NULL) {
 			g_object_set_data_full (G_OBJECT (action), "menu-icon",
 						pixbuf,
@@ -4462,8 +4460,6 @@ activate_check_mime_types (FMDirectoryVi
 	char *guessed_mime_type;
 	char *mime_type;
 	gboolean ret;
-	GnomeVFSMimeApplication *default_app;
-	GnomeVFSMimeApplication *guessed_default_app;
 
 	if (!nautilus_file_check_if_ready (file, NAUTILUS_FILE_ATTRIBUTE_SLOW_MIME_TYPE)) {
 		return FALSE;
@@ -4474,18 +4470,9 @@ activate_check_mime_types (FMDirectoryVi
 	guessed_mime_type = nautilus_file_get_guessed_mime_type (file);
 	mime_type = nautilus_file_get_mime_type (file);
 
-	if (strcmp (guessed_mime_type, mime_type) != 0) {
-		default_app = gnome_vfs_mime_get_default_application
-			(mime_type);
-		guessed_default_app = gnome_vfs_mime_get_default_application
-			(guessed_mime_type);
-		if (default_app == NULL || guessed_default_app == NULL ||
-		    !gnome_vfs_mime_application_equal (default_app, guessed_default_app)) {
-			if (warn_on_mismatch) {
-				warn_mismatched_mime_types (view, file);
-			}
-			ret = FALSE;
-		}
+	if (gnome_vfs_mime_type_get_equivalence (mime_type, guessed_mime_type) == GNOME_VFS_MIME_UNRELATED) {
+		warn_mismatched_mime_types (view, file);
+		ret = FALSE;
 	}
 
 	g_free (guessed_mime_type);
@@ -4830,8 +4817,8 @@ add_script_to_scripts_menus (FMDirectory
 	tip = g_strdup_printf (_("Run \"%s\" on any selected items"), name);
 
 	launch_parameters = script_launch_parameters_new (file, directory_view);
-	pixbuf = nautilus_icon_factory_get_pixbuf_for_file 
-		(file, NULL, NAUTILUS_ICON_SIZE_FOR_MENUS);
+	pixbuf = nautilus_icon_factory_get_pixbuf_for_file_with_stock_size
+		(file, NULL, GTK_ICON_SIZE_MENU);
 
 	action_name = escape_action_name (uri, "script_");
 	escaped_label = eel_str_double_underscores (name);
@@ -4904,8 +4891,8 @@ add_submenu_to_directory_menus (FMDirect
 	ui_manager = nautilus_window_info_get_ui_manager (directory_view->details->window);
 	uri = nautilus_file_get_uri (file);
 	name = nautilus_file_get_display_name (file);
-	pixbuf = nautilus_icon_factory_get_pixbuf_for_file 
-		(file, NULL, NAUTILUS_ICON_SIZE_FOR_MENUS);
+	pixbuf = nautilus_icon_factory_get_pixbuf_for_file_with_stock_size
+		(file, NULL, GTK_ICON_SIZE_MENU);
 	add_submenu (ui_manager, action_group, merge_id, menu_path, uri, name, pixbuf);
 	add_submenu (ui_manager, action_group, merge_id, popup_path, uri, name, pixbuf);
 	add_submenu (ui_manager, action_group, merge_id, popup_bg_path, uri, name, pixbuf);
@@ -5084,8 +5071,8 @@ add_template_to_templates_menus (FMDirec
 		*dot = 0;
 	}
 
-	pixbuf = nautilus_icon_factory_get_pixbuf_for_file 
-		(file, NULL, NAUTILUS_ICON_SIZE_FOR_MENUS);
+	pixbuf = nautilus_icon_factory_get_pixbuf_for_file_with_stock_size
+		(file, NULL, GTK_ICON_SIZE_MENU);
 
 	action_name = escape_action_name (uri, "template_");
 	escaped_label = eel_str_double_underscores (name);
@@ -6273,10 +6260,8 @@ connect_proxy (FMDirectoryView *view,
 
 	if (strcmp (gtk_action_get_name (action), FM_ACTION_NEW_EMPTY_FILE) == 0 &&
 	    GTK_IS_IMAGE_MENU_ITEM (proxy)) {
-		pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
-						   "gnome-fs-regular",
-						   NAUTILUS_ICON_SIZE_FOR_MENUS,
-						   0, NULL);
+		pixbuf = nautilus_icon_factory_get_pixbuf_from_name_with_stock_size
+			("gnome-fs-regular", NULL, GTK_ICON_SIZE_MENU, NULL);
 
 		image = gtk_image_new_from_pixbuf (pixbuf);
 		gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), image);
Index: src/file-manager/fm-list-model.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-model.c,v
retrieving revision 1.44
diff -u -p -r1.44 fm-list-model.c
--- src/file-manager/fm-list-model.c	6 Jul 2005 12:18:28 -0000	1.44
+++ src/file-manager/fm-list-model.c	27 Jul 2005 12:35:34 -0000
@@ -296,8 +296,8 @@ fm_list_model_get_value (GtkTreeModel *t
 				modifier = "visiting";
 			}
 			
-			icon = nautilus_icon_factory_get_pixbuf_for_file_force_size (file, modifier, icon_size);
-
+			icon = nautilus_icon_factory_get_pixbuf_for_file (file, modifier, icon_size, TRUE);
+  
 			g_value_set_object (value, icon);
 			g_object_unref (icon);
 		}
@@ -326,9 +326,9 @@ fm_list_model_get_value (GtkTreeModel *t
 			if (emblem_icons != NULL) {
 				zoom_level = fm_list_model_get_zoom_level_from_emblem_column_id (column);
 				icon_size = nautilus_get_icon_size_for_zoom_level (zoom_level);
-				icon = nautilus_icon_factory_get_pixbuf_for_icon_force_size (
+				icon = nautilus_icon_factory_get_pixbuf_for_icon (
 					emblem_icons->data, NULL, icon_size,
-					NULL, NULL, FALSE, NULL);
+					NULL, NULL, TRUE, FALSE, NULL);
 				eel_g_list_free_deep (emblem_icons);
 		
 				g_value_set_object (value, icon);
Index: src/file-manager/fm-properties-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-properties-window.c,v
retrieving revision 1.217
diff -u -p -r1.217 fm-properties-window.c
--- src/file-manager/fm-properties-window.c	11 Jul 2005 10:07:53 -0000	1.217
+++ src/file-manager/fm-properties-window.c	27 Jul 2005 12:35:36 -0000
@@ -413,7 +413,7 @@ get_pixbuf_for_properties_window (FMProp
 	pixbuf = nautilus_icon_factory_get_pixbuf_for_icon (icon, NULL,
 							    NAUTILUS_ICON_SIZE_STANDARD,
 							    NULL, NULL,
-							    TRUE, NULL);
+							    FALSE, TRUE, NULL);
 
 	g_free (icon);
 
Index: src/file-manager/fm-tree-model.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-tree-model.c,v
retrieving revision 1.9
diff -u -p -r1.9 fm-tree-model.c
--- src/file-manager/fm-tree-model.c	7 Jun 2005 19:10:35 -0000	1.9
+++ src/file-manager/fm-tree-model.c	27 Jul 2005 12:35:38 -0000
@@ -35,6 +35,7 @@
 #include <libnautilus-private/nautilus-file-attributes.h>
 #include <libnautilus-private/nautilus-file.h>
 #include <libnautilus-private/nautilus-icon-factory.h>
+#include <gtk/gtkenums.h>
 #include <string.h>
 
 enum {
@@ -244,12 +245,12 @@ tree_node_get_pixbuf_from_factory (TreeN
 				   const char *modifier)
 {
 	if (node->parent == NULL) {
-		return nautilus_icon_factory_get_pixbuf_from_name
+		return nautilus_icon_factory_get_pixbuf_from_name_with_stock_size
 			(node->icon_name, NULL,
-			 NAUTILUS_ICON_SIZE_FOR_MENUS, TRUE, NULL);
+			 GTK_ICON_SIZE_MENU, NULL);
 	}
-	return nautilus_icon_factory_get_pixbuf_for_file_force_size
-		(node->file, modifier, NAUTILUS_ICON_SIZE_FOR_MENUS);
+	return nautilus_icon_factory_get_pixbuf_for_file_with_stock_size
+		(node->file, modifier, GTK_ICON_SIZE_MENU);
 }
 
 static gboolean
@@ -302,9 +303,9 @@ tree_node_get_emblem_pixbuf_from_factory
 	eel_string_list_free (emblems_to_ignore);
 
 	if (emblem_icons != NULL) {
-		pixbuf = nautilus_icon_factory_get_pixbuf_for_icon
+		pixbuf = nautilus_icon_factory_get_pixbuf_for_icon_with_stock_size
 			(emblem_icons->data, NULL,
-			 NAUTILUS_ICON_SIZE_FOR_MENUS,
+			 GTK_ICON_SIZE_MENU,
 			 NULL, NULL, FALSE, NULL);
 	} else {
 		pixbuf = NULL;

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]