From 9cb637dd42f95f729812ac3fb0729e3b76a1e505 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 20 Apr 2010 18:04:49 +0000 Subject: [PATCH] Modified the CTRL+W shortcut to close the current tab instead of the window --- src/callbacks.c | 9 +++++++++ src/callbacks.h | 1 + src/surfer.c | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/callbacks.c b/src/callbacks.c index 186548b..9b7c7c7 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -57,6 +57,15 @@ void on_file_close(gpointer data) } +/* on_file_close_tab */ +void on_file_close_tab(gpointer data) +{ + Surfer * surfer = data; + + surfer_close_tab(surfer); +} + + /* on_file_new_tab */ void on_file_new_tab(gpointer data) { diff --git a/src/callbacks.h b/src/callbacks.h index 2da6c13..b7d1dc6 100644 --- a/src/callbacks.h +++ b/src/callbacks.h @@ -27,6 +27,7 @@ gboolean on_closex(gpointer data); #ifndef EMBEDDED /* file menu */ void on_file_close(gpointer data); +void on_file_close_tab(gpointer data); void on_file_new_window(gpointer data); void on_file_new_tab(gpointer data); void on_file_open(gpointer data); diff --git a/src/surfer.c b/src/surfer.c index 7534b59..d92141f 100644 --- a/src/surfer.c +++ b/src/surfer.c @@ -67,8 +67,9 @@ static DesktopMenu _menu_file[] = { "", NULL, NULL, 0 }, { N_("_Print..."), G_CALLBACK(on_file_print), GTK_STOCK_PRINT, 0 }, { "", NULL, NULL, 0 }, + { N_("Close _tab"), G_CALLBACK(on_file_close_tab), NULL, GDK_W }, { N_("_Close"), G_CALLBACK(on_file_close), GTK_STOCK_CLOSE, - GDK_W }, + 0 }, { NULL, NULL, NULL, 0 } };