aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/text')
-rw-r--r--widgets/text/e-completion-view.c47
1 files changed, 36 insertions, 11 deletions
diff --git a/widgets/text/e-completion-view.c b/widgets/text/e-completion-view.c
index a206d5da0b..c2eafb6273 100644
--- a/widgets/text/e-completion-view.c
+++ b/widgets/text/e-completion-view.c
@@ -448,7 +448,7 @@ e_completion_view_key_press_handler (GtkWidget *w, GdkEventKey *key_event, gpoin
{
ECompletionView *cv = E_COMPLETION_VIEW (user_data);
gint dir = 0;
- gboolean key_handled = TRUE, complete_key = FALSE, uncomplete_key = FALSE;
+ gboolean key_handled = TRUE, complete_key = FALSE, uncomplete_key = FALSE, is_space = FALSE;
/* FIXME: This is totally lame.
The ECompletionView should be able to specify multiple completion/uncompletion keys, or just
@@ -503,23 +503,48 @@ e_completion_view_key_press_handler (GtkWidget *w, GdkEventKey *key_event, gpoin
break;
case GDK_Tab:
- /* Unbrowse, unhandled. */
- cv->selection = -1;
- dir = 0;
- key_handled = FALSE;
+ /* If our cursor is still up in the entry, move down into
+ the popup. Otherwise unbrowse. */
+ if (cv->choices->len > 0) {
+ if (cv->selection < 0) {
+ cv->selection = 0;
+ dir = 0;
+ } else {
+ cv->selection = -1;
+ dir = 0;
+ key_handled = FALSE;
+ }
+ }
break;
- case GDK_Return:
- case GDK_KP_Enter:
case GDK_space:
case GDK_KP_Space:
- /* Only handle these key presses if we have an active selection;
- otherwise, pass them on. */
- if (cv->selection >= 0) {
+ is_space = TRUE;
+
+ case GDK_Return:
+ case GDK_KP_Enter:
+ if (cv->selection < 0) {
+ /* We don't have a selection yet, move to the first selection if there is
+ more than one option. If there is only one option, select it automatically. */
+
+ /* Let space pass through. */
+ if (is_space)
+ return FALSE;
+
+ if (cv->choices->len == 1) {
+ e_completion_view_select (cv, 0);
+ goto stop_emission;
+ } else {
+ cv->selection = 0;
+ dir = 0;
+ }
+
+ } else {
+ /* Our cursor is down in the pop-up, so we make our selection. */
e_completion_view_select (cv, cv->selection);
goto stop_emission;
}
- return FALSE;
+ break;
case GDK_Escape:
/* Unbrowse hack */
-removal&id=0c9d3031cf1a9a7dd413fdc3ff9bbfdfa3c872a8'>Chase multimedia/mp4v2 update.makc2010-08-121-1/+1 * - update audio/lame to 3.98.4netchild2010-06-031-1/+1 * - Update depobj for musepackpav2010-06-011-1/+1 * Bounce PORTREVISION for gettext-related ports. Have fun, ya'll.ade2010-05-311-1/+1 * Chase audio/libmodplug update.ehaupt2010-04-241-1/+1 * - Chase wavpack's lib dumpsylvio2010-04-101-1/+1 * - update to 1.4.1dinoex2010-03-281-1/+1 * - update to jpeg-8dinoex2010-02-051-1/+1 * - Chase taglib updatefluffy2009-12-031-2/+2 * - Switch SourceForge ports to the new File Release System: categories startin...amdmi32009-08-221-1/+1 * -Repocopy devel/libtool15 -> libtool22 and libltdl15 -> libltdl22.mezz2009-08-031-1/+1 * - bump all port that indirectly depends on libjpeg and have not yet been bump...dinoex2009-07-31