empathy r1151 - trunk/src



Author: xclaesse
Date: Sat Jun  7 17:23:09 2008
New Revision: 1151
URL: http://svn.gnome.org/viewvc/empathy?rev=1151&view=rev

Log:
Close contact list when Escape is pressed. Fixes bug #536628 (Ross Burton).


Modified:
   trunk/src/empathy-status-icon.c

Modified: trunk/src/empathy-status-icon.c
==============================================================================
--- trunk/src/empathy-status-icon.c	(original)
+++ trunk/src/empathy-status-icon.c	Sat Jun  7 17:23:09 2008
@@ -26,6 +26,7 @@
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 #include <glib/gi18n.h>
+#include <gdk/gdkkeysyms.h>
 
 #include <telepathy-glib/util.h>
 
@@ -275,7 +276,7 @@
 		GList *accounts;
 
 		empathy_window_present (GTK_WINDOW (priv->window), TRUE);
-	
+
 		/* Show the accounts dialog if there is no enabled accounts */
 		accounts = mc_accounts_list_by_enabled (TRUE);
 		if (accounts) {
@@ -326,6 +327,17 @@
 	return TRUE;
 }
 
+static gboolean
+status_icon_key_press_event_cb  (GtkWidget *window,
+				 GdkEventKey *event,
+				 EmpathyStatusIcon *icon)
+{
+	if (event->keyval == GDK_Escape) {
+		status_icon_set_visibility (icon, FALSE, TRUE);
+	}
+	return FALSE;
+}
+				
 static void
 status_icon_activate_cb (GtkStatusIcon     *status_icon,
 			 EmpathyStatusIcon *icon)
@@ -752,6 +764,10 @@
 
 	priv->window = g_object_ref (window);
 
+	g_signal_connect (priv->window, "key-press-event",
+			  G_CALLBACK (status_icon_key_press_event_cb),
+			  icon);
+
 	g_signal_connect (priv->window, "delete-event",
 			  G_CALLBACK (status_icon_delete_event_cb),
 			  icon);



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