From 7b0d469dffce0f5e5f6a9f14b8c4cd3589c41f42 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sat, 2 Feb 2008 01:46:47 +0000 Subject: 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. svn path=/trunk/; revision=7908 --- lib/widgets/ephy-location-entry.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/widgets') diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index 2121fe9cf..2dcd5386f 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -400,6 +400,21 @@ entry_key_press_after_cb (GtkEntry *entry, 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; } -- cgit v1.2.3