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



Am Mittwoch, den 27.07.2005, 15:16 +0200 schrieb Christian Neumair:
> 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

Re-attaching the 2nd part. Thanks to Vincent Noel for pointing out a
tiny issue.

-- 
Christian Neumair <chris gnome-de org>
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,
@@ -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]