From: Richard Kettlewell Date: Sun, 15 Jun 2008 11:38:52 +0000 (+0100) Subject: Choose next/prev/cancel button teleport focus back to the main view, X-Git-Tag: 4.1~15^2~10 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/62dcb54f8afcb3544906cd1fc27c2710caa2c874 Choose next/prev/cancel button teleport focus back to the main view, so that typahead find still works. --- diff --git a/disobedience/choose-search.c b/disobedience/choose-search.c index 4432151..77ad813 100644 --- a/disobedience/choose-search.c +++ b/disobedience/choose-search.c @@ -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(); } diff --git a/disobedience/choose.c b/disobedience/choose.c index 1d0cedc..c054162 100644 --- a/disobedience/choose.c +++ b/disobedience/choose.c @@ -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,