]> spindle.queued.net Git - midori/commitdiff
Tab should complete address if popup is visible
authorChristian Dywan <christian@twotoasts.de>
Fri, 29 Apr 2011 01:53:59 +0000 (03:53 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 29 Apr 2011 01:53:59 +0000 (03:53 +0200)
midori/midori-locationaction.c

index f5176062480ab208771bf1e8275bad7b04be390f..8e796c55a535aaaac5ce1dea9ba82051783602b2 100644 (file)
@@ -894,6 +894,8 @@ midori_location_action_key_press_event_cb (GtkEntry*    entry,
     case GDK_KP_Down:
     case GDK_Up:
     case GDK_KP_Up:
+    case GDK_Tab:
+    case GDK_ISO_Left_Tab:
     {
         if (location_action->popup && gtk_widget_get_visible (location_action->popup))
         {
@@ -903,7 +905,8 @@ midori_location_action_key_press_event_cb (GtkEntry*    entry,
             GtkTreeIter iter;
             gint selected = location_action->completion_index;
 
-            if (event->keyval == GDK_Down || event->keyval == GDK_KP_Down)
+            if (event->keyval == GDK_Down || event->keyval == GDK_KP_Down
+             || event->keyval == GDK_Tab  || event->keyval == GDK_ISO_Left_Tab)
                 selected = MIN (selected + 1, matches -1);
             else if (event->keyval == GDK_Up || event->keyval == GDK_KP_Up)
             {
@@ -916,6 +919,8 @@ midori_location_action_key_press_event_cb (GtkEntry*    entry,
                 selected = MIN (selected + 14, matches -1);
             else if (event->keyval == GDK_Page_Up)
                 selected = MAX (selected - 14, 0);
+            else
+                g_assert_not_reached ();
 
             path = gtk_tree_path_new_from_indices (selected, -1);
             gtk_tree_view_set_cursor (GTK_TREE_VIEW (location_action->treeview),
@@ -934,6 +939,9 @@ midori_location_action_key_press_event_cb (GtkEntry*    entry,
             return TRUE;
         }
 
+        /* Allow Tab to handle focus if the popup is closed */
+        if (event->keyval == GDK_Tab  || event->keyval == GDK_ISO_Left_Tab)
+            return FALSE;
         return TRUE;
     }
     default: