From 86927cbfca54fde174a224b5f88ed881c9413dcc Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Fri, 9 Mar 2018 02:54:50 -0800 Subject: [PATCH] menus: Convert most icons to symbolic versions (#1798) Some are left at full color where it seems to make more sense. Places, trash, cinnamon desktop specific actions. They can always be revisted as needed. It's also possible some are missed as these are spread all over nemo's code base. --- .../nemo/actions/mount-archive.nemo_action | 2 - .../nemo/actions/new-launcher.nemo_action | 2 +- .../nemo/actions/send-by-mail.nemo_action | 2 +- libnemo-private/nemo-icon-names.h | 2 +- src/nemo-places-sidebar.c | 4 +- src/nemo-tree-sidebar.c | 21 ++++++---- src/nemo-view.c | 42 +++++++++---------- src/nemo-window-menus.c | 32 +++++++------- 8 files changed, 56 insertions(+), 51 deletions(-) diff --git a/files/usr/share/nemo/actions/mount-archive.nemo_action b/files/usr/share/nemo/actions/mount-archive.nemo_action index c4553a4e7..b0b41de0b 100644 --- a/files/usr/share/nemo/actions/mount-archive.nemo_action +++ b/files/usr/share/nemo/actions/mount-archive.nemo_action @@ -10,8 +10,6 @@ Selection=s Mimetypes=application/x-7z-compressed;application/x-cd-image;application/x-cpio;application/x-rar;application/x-rar-compressed;application/x-7z-compressed-tar;application/x-bzip-compressed-tar;application/x-compressed-tar;application/x-tar;application/zip; -Stock-Id=gtk-directory - Dependencies=/usr/lib/gvfs/gvfsd-archive; Selection=s diff --git a/files/usr/share/nemo/actions/new-launcher.nemo_action b/files/usr/share/nemo/actions/new-launcher.nemo_action index 58087bd9f..dc939b48e 100644 --- a/files/usr/share/nemo/actions/new-launcher.nemo_action +++ b/files/usr/share/nemo/actions/new-launcher.nemo_action @@ -8,7 +8,7 @@ Exec=cinnamon-desktop-editor -mnemo-launcher -d"%P" Selection=None -Stock-Id=gtk-add +Icon-Name=list-add-symbolic Extensions=any; diff --git a/files/usr/share/nemo/actions/send-by-mail.nemo_action b/files/usr/share/nemo/actions/send-by-mail.nemo_action index f5980c744..d058065ae 100644 --- a/files/usr/share/nemo/actions/send-by-mail.nemo_action +++ b/files/usr/share/nemo/actions/send-by-mail.nemo_action @@ -176,7 +176,7 @@ Comment[zh_HK]=以電子郵件附件傳送 Comment[zh_TW]=以 email 附加檔案傳送 Quote=double Exec= -Icon-Name=mail-attachment +Icon-Name=mail-attachment-symbolic Selection=NotNone Extensions=nodirs; Dependencies=xdg-email diff --git a/libnemo-private/nemo-icon-names.h b/libnemo-private/nemo-icon-names.h index ab34861a4..5c26c0c0d 100644 --- a/libnemo-private/nemo-icon-names.h +++ b/libnemo-private/nemo-icon-names.h @@ -13,7 +13,7 @@ #define NEMO_ICON_SEARCH "system-search" #define NEMO_ICON_TRASH "user-trash" #define NEMO_ICON_TRASH_FULL "user-trash-full" -#define NEMO_ICON_DELETE "edit-delete" +#define NEMO_ICON_DELETE "edit-delete-symbolic" #define NEMO_ICON_FOLDER_DESKTOP "user-desktop" #define NEMO_ICON_FOLDER_DOCUMENTS "folder-documents" diff --git a/src/nemo-places-sidebar.c b/src/nemo-places-sidebar.c index a02309c97..8c40fa4b3 100644 --- a/src/nemo-places-sidebar.c +++ b/src/nemo-places-sidebar.c @@ -3372,7 +3372,7 @@ bookmarks_build_popup_menu (NemoPlacesSidebar *sidebar) item = gtk_image_menu_item_new_with_mnemonic (_("_Open")); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), - gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU)); + gtk_image_new_from_icon_name ("folder-open-symbolic", GTK_ICON_SIZE_MENU)); g_signal_connect (item, "activate", G_CALLBACK (open_shortcut_cb), sidebar); gtk_widget_show (item); @@ -3408,7 +3408,7 @@ bookmarks_build_popup_menu (NemoPlacesSidebar *sidebar) item = gtk_image_menu_item_new_with_label (_("Remove")); sidebar->popup_menu_remove_item = item; gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), - gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU)); + gtk_image_new_from_icon_name ("list-remove-symbolic", GTK_ICON_SIZE_MENU)); g_signal_connect (item, "activate", G_CALLBACK (remove_shortcut_cb), sidebar); gtk_widget_show (item); diff --git a/src/nemo-tree-sidebar.c b/src/nemo-tree-sidebar.c index 8be4b262c..8be43630a 100644 --- a/src/nemo-tree-sidebar.c +++ b/src/nemo-tree-sidebar.c @@ -1244,8 +1244,7 @@ create_popup_menu (FMTreeView *view) /* add the "open" menu item */ - menu_image = gtk_image_new_from_stock (GTK_STOCK_OPEN, - GTK_ICON_SIZE_MENU); + menu_image = gtk_image_new_from_icon_name ("folder-open-symbolic", GTK_ICON_SIZE_MENU); gtk_widget_show (menu_image); menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Open")); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), @@ -1299,7 +1298,10 @@ create_popup_menu (FMTreeView *view) eel_gtk_menu_append_separator (GTK_MENU (popup)); /* add the "cut folder" menu item */ - menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_CUT, NULL); + menu_image = gtk_image_new_from_icon_name ("edit-cut-symbolic", GTK_ICON_SIZE_MENU); + gtk_widget_show (menu_image); + menu_item = gtk_image_menu_item_new_with_mnemonic (_("Cu_t")); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), menu_image); g_signal_connect (menu_item, "activate", G_CALLBACK (fm_tree_view_cut_cb), view); @@ -1308,7 +1310,10 @@ create_popup_menu (FMTreeView *view) view->details->popup_cut = menu_item; /* add the "copy folder" menu item */ - menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_COPY, NULL); + menu_image = gtk_image_new_from_icon_name ("edit-copy-symbolic", GTK_ICON_SIZE_MENU); + gtk_widget_show (menu_image); + menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Copy")); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), menu_image); g_signal_connect (menu_item, "activate", G_CALLBACK (fm_tree_view_copy_cb), view); @@ -1317,8 +1322,7 @@ create_popup_menu (FMTreeView *view) view->details->popup_copy = menu_item; /* add the "paste files into folder" menu item */ - menu_image = gtk_image_new_from_stock (GTK_STOCK_PASTE, - GTK_ICON_SIZE_MENU); + menu_image = gtk_image_new_from_icon_name ("edit-paste-symbolic", GTK_ICON_SIZE_MENU); gtk_widget_show (menu_image); menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Paste Into Folder")); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), @@ -1390,7 +1394,10 @@ create_popup_menu (FMTreeView *view) GTK_WIDGET (eel_gtk_menu_append_separator (GTK_MENU (popup))); /* add the "properties" menu item */ - menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_PROPERTIES, NULL); + menu_image = gtk_image_new_from_icon_name ("document-properties-symbolic", GTK_ICON_SIZE_MENU); + gtk_widget_show (menu_image); + menu_item = gtk_image_menu_item_new_with_mnemonic (_("P_roperties")); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), menu_image); g_signal_connect (menu_item, "activate", G_CALLBACK (fm_tree_view_properties_cb), view); diff --git a/src/nemo-view.c b/src/nemo-view.c index 0805b53de..3d7a97cad 100644 --- a/src/nemo-view.c +++ b/src/nemo-view.c @@ -8169,10 +8169,10 @@ nemo_view_init_show_hidden_files (NemoView *view) } static const GtkActionEntry directory_view_entries[] = { - /* name, stock id, label */ { "New Documents", "document-new", N_("Create New _Document") }, + /* name, stock id, label */ { "New Documents", "document-new-symbolic", N_("Create New _Document") }, /* name, stock id, label */ { "Open With", NULL, N_("Open Wit_h"), NULL, N_("Choose a program with which to open the selected item") }, - /* name, stock id */ { "Properties", GTK_STOCK_PROPERTIES, + /* name, stock id */ { "Properties", "document-properties-symbolic", /* label, accelerator */ N_("_Properties"), "Return", /* tooltip */ N_("View or modify the properties of each selected item"), G_CALLBACK (action_properties_callback) }, @@ -8180,7 +8180,7 @@ static const GtkActionEntry directory_view_entries[] = { /* label, accelerator */ "PropertiesAccel", "I", /* tooltip */ NULL, G_CALLBACK (action_properties_callback) }, - /* name, stock id */ { "New Folder", "folder-new", + /* name, stock id */ { "New Folder", "folder-new-symbolic", /* label, accelerator */ N_("Create New _Folder"), "N", /* tooltip */ N_("Create a new empty folder inside this folder"), G_CALLBACK (action_new_folder_callback) }, @@ -8206,20 +8206,20 @@ static const GtkActionEntry directory_view_entries[] = { /* label, accelerator */ N_("Open in New _Tab"), "o", /* tooltip */ N_("Open each selected item in a new tab"), G_CALLBACK (action_open_new_tab_callback) }, - /* name, stock id */ { NEMO_ACTION_OPEN_IN_TERMINAL, "utilities-terminal", + /* name, stock id */ { NEMO_ACTION_OPEN_IN_TERMINAL, "utilities-terminal-symbolic", /* label, accelerator */ N_("Open in Terminal"), "", /* tooltip */ N_("Open terminal in the selected folder"), G_CALLBACK (action_open_in_terminal_callback) }, - /* name, stock id */ { NEMO_ACTION_OPEN_AS_ROOT, GTK_STOCK_DIALOG_AUTHENTICATION, + /* name, stock id */ { NEMO_ACTION_OPEN_AS_ROOT, "dialog-password-symbolic", /* label, accelerator */ N_("Open as Root"), "", /* tooltip */ N_("Open the folder with administration privileges"), G_CALLBACK (action_open_as_root_callback) }, - /* name, stock id */ { NEMO_ACTION_FOLLOW_SYMLINK, GTK_STOCK_JUMP_TO, + /* name, stock id */ { NEMO_ACTION_FOLLOW_SYMLINK, "go-jump-symbolic", /* label, accelerator */ N_("Follow link to original file"), "", /* tooltip */ N_("Navigate to the original file that this symbolic link points to"), G_CALLBACK (action_follow_symlink_callback) }, - /* name, stock id */ { NEMO_ACTION_OPEN_CONTAINING_FOLDER, GTK_STOCK_JUMP_TO, + /* name, stock id */ { NEMO_ACTION_OPEN_CONTAINING_FOLDER, "go-jump-symbolic", /* label, accelerator */ N_("Open containing folder"), "", /* tooltip */ N_("Navigate to the folder that the selected item is stored in"), G_CALLBACK (action_open_containing_folder_callback) }, @@ -8235,21 +8235,21 @@ static const GtkActionEntry directory_view_entries[] = { /* label, accelerator */ N_("E_mpty Trash"), NULL, /* tooltip */ N_("Delete all items in the Trash"), G_CALLBACK (action_empty_trash_callback) }, - /* name, stock id */ { "Cut", GTK_STOCK_CUT, - /* label, accelerator */ NULL, NULL, + /* name, stock id */ { "Cut", "edit-cut-symbolic", + /* label, accelerator */ N_("Cut"), "X", /* tooltip */ N_("Prepare the selected files to be moved with a Paste command"), G_CALLBACK (action_cut_files_callback) }, - /* name, stock id */ { "Copy", GTK_STOCK_COPY, - /* label, accelerator */ NULL, NULL, + /* name, stock id */ { "Copy", "edit-copy-symbolic", + /* label, accelerator */ N_("Copy"), "C", /* tooltip */ N_("Prepare the selected files to be copied with a Paste command"), G_CALLBACK (action_copy_files_callback) }, - /* name, stock id */ { "Paste", GTK_STOCK_PASTE, - /* label, accelerator */ NULL, NULL, + /* name, stock id */ { "Paste", "edit-paste-symbolic", + /* label, accelerator */ N_("Paste"), "V", /* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command"), G_CALLBACK (action_paste_files_callback) }, /* We make accelerator "" instead of null here to not inherit the stock accelerator for paste */ - /* name, stock id */ { "Paste Files Into", GTK_STOCK_PASTE, + /* name, stock id */ { "Paste Files Into", "edit-paste-symbolic", /* label, accelerator */ N_("_Paste Into Folder"), "", /* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command into the selected folder"), G_CALLBACK (action_paste_files_into_callback) }, @@ -8295,11 +8295,11 @@ static const GtkActionEntry directory_view_entries[] = { /* label, accelerator */ N_("_Restore"), NULL, NULL, G_CALLBACK (action_restore_from_trash_callback) }, - /* name, stock id */ { "Undo", GTK_STOCK_UNDO, + /* name, stock id */ { "Undo", "edit-undo-symbolic", /* label, accelerator */ N_("_Undo"), "Z", /* tooltip */ N_("Undo the last action"), G_CALLBACK (action_undo_callback) }, - /* name, stock id */ { "Redo", GTK_STOCK_REDO, + /* name, stock id */ { "Redo", "edit-redo-symbolic", /* label, accelerator */ N_("_Redo"), "Y", /* tooltip */ N_("Redo the last undone action"), G_CALLBACK (action_redo_callback) }, @@ -8388,15 +8388,15 @@ static const GtkActionEntry directory_view_entries[] = { /* tooltip */ N_("Open this folder in a new tab"), G_CALLBACK (action_location_open_in_new_tab_callback) }, - /* name, stock id */ { NEMO_ACTION_LOCATION_CUT, GTK_STOCK_CUT, + /* name, stock id */ { NEMO_ACTION_LOCATION_CUT, "edit-cut-symbolic", /* label, accelerator */ NULL, "", /* tooltip */ N_("Prepare this folder to be moved with a Paste command"), G_CALLBACK (action_location_cut_callback) }, - /* name, stock id */ { NEMO_ACTION_LOCATION_COPY, GTK_STOCK_COPY, + /* name, stock id */ { NEMO_ACTION_LOCATION_COPY, "edit-copy-symbolic", /* label, accelerator */ NULL, "", /* tooltip */ N_("Prepare this folder to be copied with a Paste command"), G_CALLBACK (action_location_copy_callback) }, - /* name, stock id */ { NEMO_ACTION_LOCATION_PASTE_FILES_INTO, GTK_STOCK_PASTE, + /* name, stock id */ { NEMO_ACTION_LOCATION_PASTE_FILES_INTO, "edit-paste-symbolic", /* label, accelerator */ N_("_Paste Into Folder"), "", /* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command into this folder"), G_CALLBACK (action_location_paste_files_into_callback) }, @@ -8438,7 +8438,7 @@ static const GtkActionEntry directory_view_entries[] = { /* tooltip */ N_("Detect media in the selected drive"), G_CALLBACK (action_location_detect_media_callback) }, - /* name, stock id */ { "LocationProperties", GTK_STOCK_PROPERTIES, + /* name, stock id */ { "LocationProperties", "document-properties-symbolic", /* label, accelerator */ N_("_Properties"), NULL, /* tooltip */ N_("View or modify the properties of this folder"), G_CALLBACK (action_location_properties_callback) }, @@ -9694,7 +9694,7 @@ real_update_menus (NemoView *view) } if (app_icon == NULL) { - app_icon = g_themed_icon_new (GTK_STOCK_OPEN); + app_icon = g_themed_icon_new ("folder-open-symbolic"); } action = gtk_action_group_get_action (view->details->dir_action_group, diff --git a/src/nemo-window-menus.c b/src/nemo-window-menus.c index f309e7d15..7b0533da9 100644 --- a/src/nemo-window-menus.c +++ b/src/nemo-window-menus.c @@ -1195,11 +1195,11 @@ static const GtkActionEntry main_entries[] = { /* name, stock id, label */ { "Edit", NULL, N_("_Edit") }, /* name, stock id, label */ { "View", NULL, N_("_View") }, /* name, stock id, label */ { "Help", NULL, N_("_Help") }, - /* name, stock id */ { "Close", GTK_STOCK_CLOSE, + /* name, stock id */ { "Close", "window-close-symbolic", /* label, accelerator */ N_("_Close"), "W", /* tooltip */ N_("Close this folder"), G_CALLBACK (action_close_window_slot_callback) }, - { "Preferences", GTK_STOCK_PREFERENCES, + { "Preferences", "preferences-other-symbolic", N_("Prefere_nces"), NULL, N_("Edit Nemo preferences"), G_CALLBACK (action_preferences_callback) }, @@ -1212,21 +1212,21 @@ static const GtkActionEntry main_entries[] = { "Z", N_("Undo the last text change"), G_CALLBACK (action_undo_callback) }, #endif - /* name, stock id, label */ { "Up", GTK_STOCK_GO_UP, N_("Open _Parent"), + /* name, stock id, label */ { "Up", "go-up-symbolic", N_("Open _Parent"), "Up", N_("Open the parent folder"), G_CALLBACK (action_up_callback) }, /* name, stock id, label */ { "UpAccel", NULL, "UpAccel", "", NULL, G_CALLBACK (action_up_callback) }, - /* name, stock id */ { "Stop", GTK_STOCK_STOP, + /* name, stock id */ { "Stop", "process-stop-symbolic", /* label, accelerator */ N_("_Stop"), NULL, /* tooltip */ N_("Stop loading the current location"), G_CALLBACK (action_stop_callback) }, - /* name, stock id */ { "Reload", GTK_STOCK_REFRESH, + /* name, stock id */ { "Reload", "view-refresh-symbolic", /* label, accelerator */ N_("_Reload"), "R", /* tooltip */ N_("Reload the current location"), G_CALLBACK (action_reload_callback) }, - /* name, stock id */ { "NemoHelp", GTK_STOCK_HELP, + /* name, stock id */ { "NemoHelp", "help-contents-symbolic", /* label, accelerator */ N_("_All Topics"), "F1", /* tooltip */ N_("Display Nemo help"), G_CALLBACK (action_nemo_manual_callback) }, @@ -1246,11 +1246,11 @@ static const GtkActionEntry main_entries[] = { label, accelerator N_("Share and transfer files"), NULL, tooltip N_("Easily transfer files to your contacts and devices from the file manager."), G_CALLBACK (action_nemo_manual_callback) }, **/ - /* name, stock id */ { "About Nemo", GTK_STOCK_ABOUT, + /* name, stock id */ { "About Nemo", "help-about-symbolic", /* label, accelerator */ N_("_About"), NULL, /* tooltip */ N_("Display credits for the creators of Nemo"), G_CALLBACK (action_about_nemo_callback) }, - /* name, stock id */ { "Zoom In", GTK_STOCK_ZOOM_IN, + /* name, stock id */ { "Zoom In", "zoom-in-symbolic", /* label, accelerator */ N_("Zoom _In"), "plus", /* tooltip */ N_("Increase the view size"), G_CALLBACK (action_zoom_in_callback) }, @@ -1262,7 +1262,7 @@ static const GtkActionEntry main_entries[] = { /* label, accelerator */ "ZoomInAccel2", "KP_Add", /* tooltip */ NULL, G_CALLBACK (action_zoom_in_callback) }, - /* name, stock id */ { "Zoom Out", GTK_STOCK_ZOOM_OUT, + /* name, stock id */ { "Zoom Out", "zoom-out-symbolic", /* label, accelerator */ N_("Zoom _Out"), "minus", /* tooltip */ N_("Decrease the view size"), G_CALLBACK (action_zoom_out_callback) }, @@ -1270,7 +1270,7 @@ static const GtkActionEntry main_entries[] = { /* label, accelerator */ "ZoomOutAccel", "KP_Subtract", /* tooltip */ NULL, G_CALLBACK (action_zoom_out_callback) }, - /* name, stock id */ { "Zoom Normal", GTK_STOCK_ZOOM_100, + /* name, stock id */ { "Zoom Normal", "zoom-original-symbolic", /* label, accelerator */ N_("Normal Si_ze"), "0", /* tooltip */ N_("Use the normal view size"), G_CALLBACK (action_zoom_normal_callback) }, @@ -1301,19 +1301,19 @@ static const GtkActionEntry main_entries[] = { /* name, stock id, label */ { "Go", NULL, N_("_Go") }, /* name, stock id, label */ { "Bookmarks", NULL, N_("_Bookmarks") }, /* name, stock id, label */ { "Tabs", NULL, N_("_Tabs") }, - /* name, stock id, label */ { "New Window", "window-new", N_("New _Window"), + /* name, stock id, label */ { "New Window", NULL, N_("New _Window"), "N", N_("Open another Nemo window for the displayed location"), G_CALLBACK (action_new_window_callback) }, - /* name, stock id, label */ { "New Tab", "tab-new", N_("New _Tab"), + /* name, stock id, label */ { "New Tab", "tab-new-symbolic", N_("New _Tab"), "T", N_("Open another tab for the displayed location"), G_CALLBACK (action_new_tab_callback) }, /* name, stock id, label */ { "Close All Windows", NULL, N_("Close _All Windows"), "Q", N_("Close all Navigation windows"), G_CALLBACK (action_close_all_windows_callback) }, - /* name, stock id, label */ { NEMO_ACTION_BACK, GTK_STOCK_GO_BACK, N_("_Back"), + /* name, stock id, label */ { NEMO_ACTION_BACK, "go-previous-symbolic", N_("_Back"), "Left", N_("Go to the previous visited location"), G_CALLBACK (action_back_callback) }, - /* name, stock id, label */ { NEMO_ACTION_FORWARD, GTK_STOCK_GO_FORWARD, N_("_Forward"), + /* name, stock id, label */ { NEMO_ACTION_FORWARD, "go-next-symbolic", N_("_Forward"), "Right", N_("Go to the next visited location"), G_CALLBACK (action_forward_callback) }, /* name, stock id, label */ { NEMO_ACTION_EDIT_LOCATION, NULL, N_("Toggle _Location Entry"), @@ -1325,7 +1325,7 @@ static const GtkActionEntry main_entries[] = { /* name, stock id, label */ { "SplitViewSameLocation", NULL, N_("Sa_me Location as Other Pane"), NULL, N_("Go to the same location as in the extra pane"), G_CALLBACK (action_split_view_same_location_callback) }, - /* name, stock id, label */ { "Add Bookmark", GTK_STOCK_ADD, N_("_Add Bookmark"), + /* name, stock id, label */ { "Add Bookmark", "bookmark-new-symbolic", N_("_Add Bookmark"), "d", N_("Add a bookmark for the current location to this menu"), G_CALLBACK (action_add_bookmark_callback) }, /* name, stock id, label */ { "Edit Bookmarks", NULL, N_("_Edit Bookmarks..."), @@ -1372,7 +1372,7 @@ static const GtkToggleActionEntry main_toggle_entries[] = { /* tooltip */ N_("Change the default visibility of the menubar"), NULL, /* is_active */ TRUE }, - /* name, stock id */ { "Search", "edit-find", + /* name, stock id */ { "Search", "edit-find-symbolic", /* label, accelerator */ N_("_Search for Files..."), "f", /* tooltip */ N_("Search documents and folders by name"), NULL,