aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormutantturkey <mutantturkey@gmail.com>2012-05-30 11:49:51 -0400
committermutantturkey <mutantturkey@gmail.com>2012-05-30 11:49:51 -0400
commit505bf65a4c0543116591a258727807cd38c42360 (patch)
tree9ed80f5b3eabc256a7b732576278a39016de5d13
parent1153c5e8f3458fbd928a191ac305cf42b6d216b0 (diff)
added a shortcut (CTRL+SHIFT+H) to toggle the tab bar
-rw-r--r--svte.c18
1 files changed, 18 insertions, 0 deletions
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 <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