[empathy] Sets sensitivity of Previous/Next Tab menu items based on gtk-keynav-wrap-around and tab position (#



commit a7fc06448ff7adffc32be7ee3b4d8232cf3ef5e9
Author: Aaron Brown <aaron j brown hotmail com>
Date:   Tue Mar 30 15:33:15 2010 +1000

    Sets sensitivity of Previous/Next Tab menu items based on gtk-keynav-wrap-around and tab position (#613382)

 src/empathy-chat-window.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index c9e04b5..302aa3a 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -333,16 +333,21 @@ chat_window_menu_context_update (EmpathyChatWindowPriv *priv,
 {
 	gboolean first_page;
 	gboolean last_page;
+	gboolean wrap_around;
 	gboolean is_connected;
 	gint     page_num;
 
 	page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
 	first_page = (page_num == 0);
 	last_page = (page_num == (num_pages - 1));
+	g_object_get (gtk_settings_get_default (), "gtk-keynav-wrap-around",
+		      &wrap_around, NULL);
 	is_connected = empathy_chat_get_tp_chat (priv->current_chat) != NULL;
 
-	gtk_action_set_sensitive (priv->menu_tabs_next, TRUE);
-	gtk_action_set_sensitive (priv->menu_tabs_prev, TRUE);
+	gtk_action_set_sensitive (priv->menu_tabs_next, (!last_page ||
+							 wrap_around));
+	gtk_action_set_sensitive (priv->menu_tabs_prev, (!first_page ||
+							 wrap_around));
 	gtk_action_set_sensitive (priv->menu_tabs_detach, num_pages > 1);
 	gtk_action_set_sensitive (priv->menu_tabs_left, !first_page);
 	gtk_action_set_sensitive (priv->menu_tabs_right, !last_page);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]