empathy r1207 - trunk/libempathy-gtk



Author: xclaesse
Date: Tue Jul  8 10:58:27 2008
New Revision: 1207
URL: http://svn.gnome.org/viewvc/empathy?rev=1207&view=rev

Log:
Made the Close button the default widget in the contact edit dialog. (Jonny Lamb)

Having this Close button the default widget in the contact edit dialog
allows one to enter/edit a contact's alias, and press return when
finished, instead of TABing one's to Close, or worse, having to
use the mouse!

Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>


Modified:
   trunk/libempathy-gtk/empathy-contact-dialogs.c
   trunk/libempathy-gtk/empathy-contact-widget.c

Modified: trunk/libempathy-gtk/empathy-contact-dialogs.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-dialogs.c	(original)
+++ trunk/libempathy-gtk/empathy-contact-dialogs.c	Tue Jul  8 10:58:27 2008
@@ -192,6 +192,8 @@
 	gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
 				      button,
 				      GTK_RESPONSE_CLOSE);
+	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+	gtk_window_set_default (GTK_WINDOW (dialog), button);
 	gtk_widget_show (button);
 
 	/* Contact info widget */

Modified: trunk/libempathy-gtk/empathy-contact-widget.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-widget.c	(original)
+++ trunk/libempathy-gtk/empathy-contact-widget.c	Tue Jul  8 10:58:27 2008
@@ -406,6 +406,8 @@
 		g_signal_connect (information->widget_alias, "focus-out-event",
 				  G_CALLBACK (contact_widget_entry_alias_focus_event_cb),
 				  information);
+		/* Make return activate the window default (the Close button) */
+		gtk_entry_set_activates_default (GTK_ENTRY (information->widget_alias), TRUE);
 	} else {
 		information->widget_alias = gtk_label_new (NULL);
 		gtk_label_set_selectable (GTK_LABEL (information->widget_alias), TRUE);



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