# HG changeset patch # User zas_ # Date 1236522439 0 # Node ID 9e7aed6ba6bd8bc1839330cfba13ee0496b1a802 # Parent a0bd58a6535fc1ab4176388b56a3fe76d39bde95 Display icons in edit contextual menu. diff -r a0bd58a6535f -r 9e7aed6ba6bd src/menu.c --- a/src/menu.c Sun Mar 08 13:23:25 2009 +0000 +++ b/src/menu.c Sun Mar 08 14:27:19 2009 +0000 @@ -21,6 +21,7 @@ #include "editors.h" #include "filedata.h" #include "img-view.h" +#include "pixbuf_util.h" #include "preferences.h" #include "slideshow.h" #include "utilops.h" @@ -83,7 +84,13 @@ } if (active) - menu_item_add(menu, editor->name, func, editor->key); + { + const gchar *stock_id = NULL; + if (editor->icon && register_theme_icon_as_stock(editor->key, editor->icon)) + stock_id = editor->key; + + menu_item_add_stock(menu, editor->name, stock_id, func, editor->key); + } } g_list_free(editors_list); diff -r a0bd58a6535f -r 9e7aed6ba6bd src/pixbuf_util.c --- a/src/pixbuf_util.c Sun Mar 08 13:23:25 2009 +0000 +++ b/src/pixbuf_util.c Sun Mar 08 14:27:19 2009 +0000 @@ -166,6 +166,9 @@ GError *error = NULL; icon_theme = gtk_icon_theme_get_default(); + + if (gtk_icon_theme_has_icon(icon_theme, key)) return FALSE; + pixbuf = gtk_icon_theme_load_icon(icon_theme, icon, /* icon name */ 64, /* size */