diff --git a/terminal/terminal-stock.c b/terminal/terminal-stock.c index 108b63e..6207fe2 100644 --- a/terminal/terminal-stock.c +++ b/terminal/terminal-stock.c @@ -34,25 +34,29 @@ #include +typedef struct +{ + const gchar* icon_name; /* the internal icon name */ + const gchar* alternative; /* a standards compliant name */ +} TerminalIconName; - -static const gchar *terminal_stock_icons[] = +static TerminalIconName terminal_stock_icons[] = { - TERMINAL_STOCK_CLOSETAB, - TERMINAL_STOCK_CLOSEWINDOW, - TERMINAL_STOCK_FULLSCREEN, - TERMINAL_STOCK_GENERAL, - TERMINAL_STOCK_NEWTAB, - TERMINAL_STOCK_NEWWINDOW, - TERMINAL_STOCK_REPORTBUG, - TERMINAL_STOCK_SHOWBORDERS, - TERMINAL_STOCK_SHOWMENU, - - TERMINAL_STOCK_ADVANCED, - TERMINAL_STOCK_APPEARANCE, - TERMINAL_STOCK_COLORS, - TERMINAL_STOCK_COMPOSE, - TERMINAL_STOCK_SHORTCUTS, + { TERMINAL_STOCK_CLOSETAB, "tab-close" }, + { TERMINAL_STOCK_CLOSEWINDOW, "window-close" }, + { TERMINAL_STOCK_FULLSCREEN, "view-fullscreen" }, + { TERMINAL_STOCK_GENERAL, NULL }, + { TERMINAL_STOCK_NEWTAB, "tab-new" }, + { TERMINAL_STOCK_NEWWINDOW, "window-new" }, + { TERMINAL_STOCK_REPORTBUG, NULL }, + { TERMINAL_STOCK_SHOWBORDERS, NULL }, + { TERMINAL_STOCK_SHOWMENU, NULL }, + + { TERMINAL_STOCK_ADVANCED, NULL }, + { TERMINAL_STOCK_APPEARANCE, NULL }, + { TERMINAL_STOCK_COLORS, NULL }, + { TERMINAL_STOCK_COMPOSE, NULL }, + { TERMINAL_STOCK_SHORTCUTS, NULL }, }; @@ -84,13 +88,23 @@ terminal_stock_init (void) for (n = 0; n < G_N_ELEMENTS (terminal_stock_icons); ++n) { /* set the new icon name for the icon source */ - strcpy (icon_name + (sizeof ("stock_") - 1), terminal_stock_icons[n]); - gtk_icon_source_set_icon_name (icon_source, icon_name); + strcpy (icon_name + (sizeof ("stock_") - 1), + terminal_stock_icons[n].icon_name); /* allocate the icon set */ icon_set = gtk_icon_set_new (); + /* set the new icon name for the icon source */ + gtk_icon_source_set_icon_name (icon_source, icon_name); gtk_icon_set_add_source (icon_set, icon_source); - gtk_icon_factory_add (icon_factory, terminal_stock_icons[n], icon_set); + /* if we have one, add an alternative, standards compliant icon name */ + if (terminal_stock_icons[n].alternative) + { + gtk_icon_source_set_icon_name (icon_source, + terminal_stock_icons[n].alternative); + gtk_icon_set_add_source (icon_set, icon_source); + } + gtk_icon_factory_add (icon_factory, + terminal_stock_icons[n].icon_name, icon_set); gtk_icon_set_unref (icon_set); }