epiphany r7908 - trunk/lib/widgets



Author: cosimoc
Date: Sat Feb  2 01:46:47 2008
New Revision: 7908
URL: http://svn.gnome.org/viewvc/epiphany?rev=7908&view=rev

Log:
Popup the completion dropdown menu when we're focusing the location bar
with the cursor at the end of entry and we press down. Bug #340572.


Modified:
   trunk/lib/widgets/ephy-location-entry.c

Modified: trunk/lib/widgets/ephy-location-entry.c
==============================================================================
--- trunk/lib/widgets/ephy-location-entry.c	(original)
+++ trunk/lib/widgets/ephy-location-entry.c	Sat Feb  2 01:46:47 2008
@@ -400,6 +400,21 @@
 
 		return TRUE;
 	}
+	
+	if ((event->keyval == GDK_Down || event->keyval == GDK_KP_Down)
+	    && state == 0)
+	{
+		/* If we are focusing the entry, with the cursor at the end of it
+		 * we emit the changed signal, so that the completion popup appears */
+		const char *string;
+		
+		string = gtk_entry_get_text (entry);
+		if (gtk_editable_get_position (GTK_EDITABLE (entry)) == strlen (string))
+		{
+			g_signal_emit_by_name (entry, "changed", 0);
+			return TRUE;
+		}
+	}
 
 	return FALSE;
 }



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