? autom4te.cache
? gnome_terminal_jwillcox_close_button_v1.diff
? help/C/gnome-terminal-C.omf.out
? help/ro/gnome-terminal-ro.omf.out
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-terminal/ChangeLog,v
retrieving revision 1.323
diff -u -r1.323 ChangeLog
--- ChangeLog	7 Sep 2003 00:20:17 -0000	1.323
+++ ChangeLog	7 Sep 2003 18:24:48 -0000
@@ -1,3 +1,10 @@
+2003-09-07  James Willcox  <jwillcox@gnome.org>
+
+	* src/terminal-window.c: (close_cb), (create_notebook_tab),
+	(terminal_window_add_screen):
+
+	Add a close button to the tabs
+
 2003-09-06 Mariano Suárez-Alvarez <msuarezalvarez@arnet.com.ar>
 
 	* src/Makefile.am: added INTLTOOL_SCHEMAS_RULE.
Index: src/terminal-window.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-window.c,v
retrieving revision 1.77
diff -u -r1.77 terminal-window.c
--- src/terminal-window.c	16 Jul 2003 01:36:09 -0000	1.77
+++ src/terminal-window.c	7 Sep 2003 18:24:48 -0000
@@ -1250,6 +1250,46 @@
   update_copy_sensitivity (window);
 }
 
+static void
+close_cb (GtkWidget *button, gpointer user_data)
+{
+  TerminalScreen *screen = user_data;
+
+  terminal_window_remove_screen (terminal_screen_get_window (screen), screen);
+}
+
+static GtkWidget *
+create_notebook_tab (TerminalScreen *screen)
+{
+  GtkWidget *box;
+  GtkWidget *label;
+  GtkWidget *button;
+  GtkSettings *settings;
+  int width, height;
+
+  box = gtk_hbox_new (FALSE, FALSE);
+
+  label = screen_get_label (screen);
+  button = gtk_button_new ();
+  gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+  gtk_container_add (GTK_CONTAINER (button),
+                     gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU));
+
+  settings = gtk_widget_get_settings (label);
+  gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &width,
+                                     &height);
+  gtk_widget_set_size_request (button, width + 2, height + 2);
+  
+  g_signal_connect (button, "clicked", G_CALLBACK (close_cb), screen);
+
+  gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 6);
+  gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 6);
+
+  gtk_widget_show_all (box);
+
+  return box;
+}
+
 void
 terminal_window_add_screen (TerminalWindow *window,
                             TerminalScreen *screen)
@@ -1318,7 +1358,7 @@
   
   gtk_notebook_append_page (GTK_NOTEBOOK (window->priv->notebook),
                             hbox,
-                            label);
+                            create_notebook_tab (screen));
 
   reset_tab_menuitems (window);
   update_tab_sensitivity (window);
