[Xfce4-commits] r30114 - in terminal/trunk: icons/24x24 icons/48x48 terminal

Nick Schermer nick at xfce.org
Sun Jun 28 17:36:15 CEST 2009


Author: nick
Date: 2009-06-28 15:36:15 +0000 (Sun, 28 Jun 2009)
New Revision: 30114

Removed:
   terminal/trunk/icons/24x24/stock_terminal-fullscreen.png
   terminal/trunk/icons/48x48/stock_terminal-advanced.png
   terminal/trunk/icons/48x48/stock_terminal-appearance.png
   terminal/trunk/icons/48x48/stock_terminal-colors.png
   terminal/trunk/icons/48x48/stock_terminal-general.png
   terminal/trunk/icons/48x48/stock_terminal-shortcuts.png
Modified:
   terminal/trunk/icons/24x24/Makefile.am
   terminal/trunk/icons/48x48/Makefile.am
   terminal/trunk/terminal/terminal-stock.c
   terminal/trunk/terminal/terminal-stock.h
   terminal/trunk/terminal/terminal-window.c
Log:
Use stock icons and remove unused icons (bug #5495).


Modified: terminal/trunk/icons/24x24/Makefile.am
===================================================================
--- terminal/trunk/icons/24x24/Makefile.am	2009-06-28 13:43:50 UTC (rev 30113)
+++ terminal/trunk/icons/24x24/Makefile.am	2009-06-28 15:36:15 UTC (rev 30114)
@@ -4,7 +4,6 @@
 icons_DATA =								\
 	stock_terminal-closetab.png					\
 	stock_terminal-closewindow.png					\
-	stock_terminal-fullscreen.png					\
 	stock_terminal-newtab.png					\
 	stock_terminal-newwindow.png					\
 	stock_terminal-reportbug.png					\

Modified: terminal/trunk/icons/48x48/Makefile.am
===================================================================
--- terminal/trunk/icons/48x48/Makefile.am	2009-06-28 13:43:50 UTC (rev 30113)
+++ terminal/trunk/icons/48x48/Makefile.am	2009-06-28 15:36:15 UTC (rev 30114)
@@ -5,13 +5,7 @@
 	Terminal.png
 
 stockdir = $(datadir)/icons/hicolor/48x48/stock/navigation
-stock_DATA =								\
-	stock_terminal-advanced.png					\
-	stock_terminal-appearance.png					\
-	stock_terminal-colors.png					\
-	stock_terminal-compose.png					\
-	stock_terminal-general.png					\
-	stock_terminal-shortcuts.png
+stock_DATA = stock_terminal-compose.png
 
 EXTRA_DIST =								\
 	$(apps_DATA)							\

Modified: terminal/trunk/terminal/terminal-stock.c
===================================================================
--- terminal/trunk/terminal/terminal-stock.c	2009-06-28 13:43:50 UTC (rev 30113)
+++ terminal/trunk/terminal/terminal-stock.c	2009-06-28 15:36:15 UTC (rev 30114)
@@ -35,24 +35,24 @@
 #include <terminal/terminal-stock.h>
 
 
+typedef struct
+{
+  const gchar *name;
+  const gchar *stock;
+} TerminalStockIcon;
 
-static const gchar *terminal_stock_icons[] =
+
+
+static const TerminalStockIcon 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_NEWTAB,      "tab-new" },
+  { TERMINAL_STOCK_NEWWINDOW,   "window-new" },
+  { TERMINAL_STOCK_REPORTBUG,   NULL },
+  { TERMINAL_STOCK_SHOWBORDERS, NULL },
+  { TERMINAL_STOCK_SHOWMENU,    NULL },
+  { TERMINAL_STOCK_COMPOSE,     NULL }
 };
 
 
@@ -68,15 +68,12 @@
   GtkIconFactory *icon_factory;
   GtkIconSource  *icon_source;
   GtkIconSet     *icon_set;
-  gchar           icon_name[128];
+  gchar           icon_name[50];
   guint           n;
 
   /* allocate a new icon factory for the terminal icons */
   icon_factory = gtk_icon_factory_new ();
 
-  /* all icon names start with "stock_" */
-  memcpy (icon_name, "stock_", sizeof ("stock_"));
-
   /* we try to avoid allocating multiple icon sources */
   icon_source = gtk_icon_source_new ();
 
@@ -84,13 +81,25 @@
   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);
+      g_snprintf (icon_name, sizeof (icon_name), "stock_%s",
+                  terminal_stock_icons[n].name);
 
       /* allocate the icon set */
       icon_set = gtk_icon_set_new ();
+      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);
+
+      /* add an alternative stock name if there is one */
+      if (terminal_stock_icons[n].stock != NULL)
+        {
+          gtk_icon_source_set_icon_name (icon_source,
+              terminal_stock_icons[n].stock);
+          gtk_icon_set_add_source (icon_set, icon_source);
+        }
+
+      /* add to the factory */
+      gtk_icon_factory_add (icon_factory,
+          terminal_stock_icons[n].name, icon_set);
       gtk_icon_set_unref (icon_set);
     }
 

Modified: terminal/trunk/terminal/terminal-stock.h
===================================================================
--- terminal/trunk/terminal/terminal-stock.h	2009-06-28 13:43:50 UTC (rev 30113)
+++ terminal/trunk/terminal/terminal-stock.h	2009-06-28 15:36:15 UTC (rev 30114)
@@ -26,19 +26,12 @@
 
 #define TERMINAL_STOCK_CLOSETAB     "terminal-closetab"
 #define TERMINAL_STOCK_CLOSEWINDOW  "terminal-closewindow"
-#define TERMINAL_STOCK_FULLSCREEN   "terminal-fullscreen"
-#define TERMINAL_STOCK_GENERAL      "terminal-general"
 #define TERMINAL_STOCK_NEWTAB       "terminal-newtab"
 #define TERMINAL_STOCK_NEWWINDOW    "terminal-newwindow"
 #define TERMINAL_STOCK_REPORTBUG    "terminal-reportbug"
 #define TERMINAL_STOCK_SHOWBORDERS  "terminal-showborders"
 #define TERMINAL_STOCK_SHOWMENU     "terminal-showmenu"
-
-#define TERMINAL_STOCK_ADVANCED     "terminal-advanced"
-#define TERMINAL_STOCK_APPEARANCE   "terminal-appearance"
-#define TERMINAL_STOCK_COLORS       "terminal-colors"
 #define TERMINAL_STOCK_COMPOSE      "terminal-compose"
-#define TERMINAL_STOCK_SHORTCUTS    "terminal-shortcuts"
 
 void terminal_stock_init (void);
 

Modified: terminal/trunk/terminal/terminal-window.c
===================================================================
--- terminal/trunk/terminal/terminal-window.c	2009-06-28 13:43:50 UTC (rev 30113)
+++ terminal/trunk/terminal/terminal-window.c	2009-06-28 15:36:15 UTC (rev 30114)
@@ -243,7 +243,7 @@
   { "show-menubar", TERMINAL_STOCK_SHOWMENU, N_ ("Show _Menubar"), NULL, N_ ("Show/hide the menubar"), G_CALLBACK (terminal_window_action_show_menubar), TRUE, },
   { "show-toolbars", NULL, N_ ("Show _Toolbars"), NULL, N_ ("Show/hide the toolbars"), G_CALLBACK (terminal_window_action_show_toolbars), FALSE, },
   { "show-borders", TERMINAL_STOCK_SHOWBORDERS, N_ ("Show Window _Borders"), NULL, N_ ("Show/hide the window decorations"), G_CALLBACK (terminal_window_action_show_borders), TRUE, },
-  { "fullscreen", TERMINAL_STOCK_FULLSCREEN, N_ ("_Fullscreen"), NULL, N_ ("Toggle fullscreen mode"), G_CALLBACK (terminal_window_action_fullscreen), FALSE, },
+  { "fullscreen", GTK_STOCK_FULLSCREEN, N_ ("_Fullscreen"), NULL, N_ ("Toggle fullscreen mode"), G_CALLBACK (terminal_window_action_fullscreen), FALSE, },
 };
 
 




More information about the Xfce4-commits mailing list