From 7cd5db58862b57db5a1a67b6e2f5e61746e9fb07 Mon Sep 17 00:00:00 2001 From: mrhappypants Date: Wed, 17 Mar 2010 08:30:16 +1000 Subject: Added gtk-keynav-wrap-around check before cycling tabs --- src/empathy-chat-window.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 29d574a3e..282c40e24 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -1027,14 +1027,18 @@ chat_window_tabs_next_activate_cb (GtkAction *action, EmpathyChatWindowPriv *priv; EmpathyChat *chat; gint index_, numPages; + gboolean wrap_around; priv = GET_PRIV (window); + g_object_get (gtk_settings_get_default (), "gtk-keynav-wrap-around", + &wrap_around, NULL); + chat = priv->current_chat; index_ = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook)); numPages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (priv->notebook)); - if (index_ == (numPages - 1)) { + if (index_ == (numPages - 1) && wrap_around) { gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), 0); return; } @@ -1049,14 +1053,18 @@ chat_window_tabs_previous_activate_cb (GtkAction *action, EmpathyChatWindowPriv *priv; EmpathyChat *chat; gint index_, numPages; + gboolean wrap_around; priv = GET_PRIV (window); + g_object_get (gtk_settings_get_default (), "gtk-keynav-wrap-around", + &wrap_around, NULL); + chat = priv->current_chat; index_ = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook)); numPages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (priv->notebook)); - if (index_ <= 0) { + if (index_ <= 0 && wrap_around) { gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), numPages - 1); return; } -- cgit v1.2.3