From 62dcb54f8afcb3544906cd1fc27c2710caa2c874 Mon Sep 17 00:00:00 2001 Message-Id: <62dcb54f8afcb3544906cd1fc27c2710caa2c874.1715833408.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sun, 15 Jun 2008 12:38:52 +0100 Subject: [PATCH] Choose next/prev/cancel button teleport focus back to the main view, so that typahead find still works. Organization: Straylight/Edgeware From: Richard Kettlewell --- disobedience/choose-search.c | 6 +++--- disobedience/choose.c | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) 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, -- [mdw]