chiark / gitweb /
Choose next/prev/cancel button teleport focus back to the main view,
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 15 Jun 2008 11:38:52 +0000 (12:38 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 15 Jun 2008 11:38:52 +0000 (12:38 +0100)
so that typahead find still works.

disobedience/choose-search.c
disobedience/choose.c

index 44321519e966d5294b76aa752d6c84fc53e7d7a6..77ad813a8b93afa73c8e19e64a66296b3d9759ae 100644 (file)
@@ -19,9 +19,6 @@
  */
 /** @file disobedience/search.c
  * @brief Search support
- *
- * TODO:
- * - cleverer focus to implement typeahead find
  */
 #include "disobedience.h"
 #include "choose.h"
@@ -436,6 +433,7 @@ static gboolean choose_get_visible_range(GtkTreeView *tree_view,
 
 void choose_next_clicked(GtkButton attribute((unused)) *button,
                          gpointer attribute((unused)) userdata) {
+  gtk_widget_grab_focus(choose_view);
   if(!choose_n_search_results)
     return;
   /* Find the last visible row */
@@ -473,6 +471,7 @@ void choose_next_clicked(GtkButton attribute((unused)) *button,
 
 void choose_prev_clicked(GtkButton attribute((unused)) *button,
                          gpointer attribute((unused)) userdata) {
+  gtk_widget_grab_focus(choose_view);
   /* TODO can we de-dupe with choose_next_clicked?  Probably yes. */
   if(!choose_n_search_results)
     return;
@@ -513,6 +512,7 @@ void choose_prev_clicked(GtkButton attribute((unused)) *button,
 static void choose_clear_clicked(GtkButton attribute((unused)) *button,
                                  gpointer attribute((unused)) userdata) {
   gtk_entry_set_text(GTK_ENTRY(choose_search_entry), "");
+  gtk_widget_grab_focus(choose_view);
   /* We start things off straight away in this case */
   initiate_search();
 }
index 1d0cedc402a15f09ea36f4502c74391ed8bd4f6d..c0541624edb840e4e10115c125db6dfe9d815474 100644 (file)
@@ -507,8 +507,6 @@ static void choose_refill(const char attribute((unused)) *event,
 }
 
 /** @brief Called for key-*-event on the main view
- *
- * Switches focus to the 
  */
 static gboolean choose_key_event(GtkWidget attribute((unused)) *widget,
                                  GdkEventKey *event,