Mercurial > geeqie.yaz
changeset 1398:9e7aed6ba6bd
Display icons in edit contextual menu.
author | zas_ |
---|---|
date | Sun, 08 Mar 2009 14:27:19 +0000 |
parents | a0bd58a6535f |
children | 7dfa34e4de15 |
files | src/menu.c src/pixbuf_util.c |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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 */