[empathy] Added gtk-keynav-wrap-around check before cycling tabs
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Added gtk-keynav-wrap-around check before cycling tabs
- Date: Wed, 17 Mar 2010 09:20:40 +0000 (UTC)
commit 7cd5db58862b57db5a1a67b6e2f5e61746e9fb07
Author: mrhappypants <aaron j brown hotmail com>
Date: Wed Mar 17 08:30:16 2010 +1000
Added gtk-keynav-wrap-around check before cycling tabs
src/empathy-chat-window.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 29d574a..282c40e 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]