diff options
author | mutantturkey <mutantturkey@gmail.com> | 2012-05-30 11:49:51 -0400 |
---|---|---|
committer | mutantturkey <mutantturkey@gmail.com> | 2012-05-30 11:49:51 -0400 |
commit | 505bf65a4c0543116591a258727807cd38c42360 (patch) | |
tree | 9ed80f5b3eabc256a7b732576278a39016de5d13 | |
parent | 1153c5e8f3458fbd928a191ac305cf42b6d216b0 (diff) |
added a shortcut (CTRL+SHIFT+H) to toggle the tab bar
-rw-r--r-- | svte.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -21,6 +21,7 @@ #include "defaults.h" #include <gdk/gdkkeysyms.h> #include <glib/goption.h> +#include <glib.h> #include <gtk/gtk.h> #include <vte/vte.h> #include <unistd.h> @@ -48,6 +49,7 @@ static void tab_switch(gboolean b); static void tab_title(); static void tab_geometry_hints(); static void tab_new(); +static void tab_togglebar(); static void configure_window(); static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data); @@ -109,6 +111,10 @@ gboolean event_key(GtkWidget *widget, GdkEventKey *event) { tab_new(); return TRUE; } + if (g == GDK_H) { + tab_togglebar(); + return TRUE; + } if (g == GDK_W) { tab_close(); return TRUE; @@ -162,6 +168,18 @@ static void tab_close() { } } +static void tab_togglebar() { + + if(gtk_notebook_get_show_tabs(GTK_NOTEBOOK(svte.notebook))) { + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(svte.notebook), FALSE); + } + else { + if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(svte.notebook)) != 1) { + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(svte.notebook), TRUE); + } + } +} + /* Retrieve the cwd of the specified term page. * Original function was from terminal-screen.c of gnome-terminal, copyright (C) 2001 Havoc Pennington |