diff --git a/thunar/thunar-window-ui.xml b/thunar/thunar-window-ui.xml index 198f1c51..d251a706 100644 --- a/thunar/thunar-window-ui.xml +++ b/thunar/thunar-window-ui.xml @@ -119,6 +119,8 @@ + + diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 6db84bf3..560dfd91 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -169,6 +169,10 @@ static void thunar_window_action_preferences (GtkAction ThunarWindow *window); static void thunar_window_action_reload (GtkAction *action, ThunarWindow *window); +static void switch_next_tab (GtkAction *action, + ThunarWindow *window); +static void switch_previous_tab (GtkAction *action, + ThunarWindow *window); static void thunar_window_action_pathbar_changed (GtkToggleAction *action, ThunarWindow *window); static void thunar_window_action_toolbar_changed (GtkToggleAction *action, @@ -352,6 +356,8 @@ static GtkActionEntry action_entries[] = { "sendto-menu", NULL, N_ ("_Send To"), NULL, }, { "empty-trash", NULL, N_ ("_Empty Trash"), NULL, N_ ("Delete all files and folders in the Trash"), G_CALLBACK (thunar_window_action_empty_trash), }, { "detach-tab", NULL, N_ ("Detac_h Tab"), NULL, N_ ("Open current folder in a new window"), G_CALLBACK (thunar_window_action_detach_tab), }, + { "switch-previous-tab", "go-previous", N_ ("_Previous Tab"), "Page_Up", N_ ("Switch to Previous Tab"), G_CALLBACK (switch_previous_tab), }, + { "switch-next-tab", "go-next", N_ ("_Next Tab"), "Page_Down", N_ ("Switch to Next Tab"), G_CALLBACK (switch_next_tab), }, { "close-all-windows", NULL, N_ ("Close _All Windows"), "W", N_ ("Close all Thunar windows"), G_CALLBACK (thunar_window_action_close_all_windows), }, { "close-tab", "window-close", N_ ("C_lose Tab"), "W", N_ ("Close this folder"), G_CALLBACK (thunar_window_action_close_tab), }, { "close-window", "application-exit", N_ ("_Close Window"), "Q", N_ ("Close this window"), G_CALLBACK (thunar_window_action_close_window), }, @@ -1360,6 +1366,40 @@ thunar_window_tab_change (ThunarWindow *window, +static void +switch_next_tab (GtkAction *action, + ThunarWindow *window) +{ + gint current_page_idx; + gint new_page_idx; + + _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + + current_page_idx = gtk_notebook_get_current_page (GTK_NOTEBOOK (window->notebook)); + new_page_idx = (current_page_idx + 1) + % gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)); + gtk_notebook_set_current_page (GTK_NOTEBOOK (window->notebook), new_page_idx); +} + + + +static void +switch_previous_tab (GtkAction *action, + ThunarWindow *window) +{ + gint current_page_idx; + gint new_page_idx; + + _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + + current_page_idx = gtk_notebook_get_current_page (GTK_NOTEBOOK (window->notebook)); + new_page_idx = (current_page_idx - 1) + % gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)); + gtk_notebook_set_current_page (GTK_NOTEBOOK (window->notebook), new_page_idx); +} + + + static void thunar_window_realize (GtkWidget *widget) {