Using stock menu items when available

This commit is contained in:
Pierre Pronchery 2007-12-17 01:41:35 +00:00
parent 19d477fbe3
commit a19d8d2780
2 changed files with 6 additions and 2 deletions

View File

@ -15,6 +15,7 @@
#include <string.h>
#include "common.h"
@ -46,6 +47,9 @@ GtkWidget * common_new_menubar(GtkWindow * window, struct _menubar * mb,
else if(p->stock == NULL)
menuitem = gtk_menu_item_new_with_mnemonic(
p->name);
else if(strncmp(p->stock, "gtk-", 4) == 0)
menuitem = gtk_image_menu_item_new_from_stock(
p->stock, NULL);
else
{
image = gtk_image_new_from_icon_name(p->stock,

View File

@ -47,8 +47,8 @@ static struct _menu _menu_file[] =
static struct _menu _menu_edit[] =
{
{ "_Undo", G_CALLBACK(on_compose_edit_undo), "stock_undo", GDK_Z },
{ "_Redo", G_CALLBACK(on_compose_edit_redo), "stock_redo", GDK_Y },
{ "_Undo", G_CALLBACK(on_compose_edit_undo), GTK_STOCK_UNDO, GDK_Z },
{ "_Redo", G_CALLBACK(on_compose_edit_redo), GTK_STOCK_REDO, GDK_Y },
{ "", NULL, NULL, 0 },
{ "_Cut", G_CALLBACK(on_compose_edit_cut), GTK_STOCK_CUT, GDK_X },
{ "_Copy", G_CALLBACK(on_compose_edit_copy), GTK_STOCK_COPY, GDK_C },