From 505bf65a4c0543116591a258727807cd38c42360 Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Wed, 30 May 2012 11:49:51 -0400 Subject: added a shortcut (CTRL+SHIFT+H) to toggle the tab bar --- svte.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/svte.c b/svte.c index 20d059f..afe404b 100644 --- a/svte.c +++ b/svte.c @@ -21,6 +21,7 @@ #include "defaults.h" #include #include +#include #include #include #include @@ -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 -- cgit v1.2.3