chiark / gitweb /
Saner ^F behaviour.
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 14 Jun 2008 19:29:48 +0000 (20:29 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sat, 14 Jun 2008 19:29:48 +0000 (20:29 +0100)
disobedience/choose-search.c
disobedience/choose.c
disobedience/choose.h

index ebbedf0..4432151 100644 (file)
@@ -517,6 +517,11 @@ static void choose_clear_clicked(GtkButton attribute((unused)) *button,
   initiate_search();
 }
 
+/** @brief Called when the user hits ^F to start a new search */
+void choose_search_new(void) {
+  gtk_editable_select_region(GTK_EDITABLE(choose_search_entry), 0, -1);
+}
+
 /** @brief Create the search widget */
 GtkWidget *choose_search_widget(void) {
 
index 2ddf7f9..1d0cedc 100644 (file)
@@ -528,8 +528,8 @@ static gboolean choose_key_event(GtkWidget attribute((unused)) *widget,
      * search entry box. */
     if((event->state & ~(GDK_LOCK_MASK|GDK_SHIFT_MASK)) == GDK_CONTROL_MASK
        && event->type == GDK_KEY_PRESS) {
-      gtk_widget_grab_focus(user_data);
-      return FALSE;
+      choose_search_new();
+      return TRUE;                      /* Handled it */
     }
     break;
   case 'g': case 'G':
@@ -538,12 +538,12 @@ static gboolean choose_key_event(GtkWidget attribute((unused)) *widget,
     if((event->state & ~(GDK_LOCK_MASK|GDK_SHIFT_MASK)) == GDK_CONTROL_MASK
        && event->type == GDK_KEY_PRESS) {
       choose_next_clicked(0, 0);
-      return FALSE;
+      return TRUE;                      /* Handled it */
     }
     break;
   }
   gtk_widget_event(user_data, (GdkEvent *)event);
-  return TRUE;
+  return TRUE;                          /* Handled it */
 }
 
 /** @brief Create the choose tab */
index 69460c4..1a9bf10 100644 (file)
@@ -77,6 +77,7 @@ void choose_next_clicked(GtkButton *button,
                          gpointer userdata);
 void choose_prev_clicked(GtkButton *button,
                          gpointer userdata);
+void choose_search_new(void);
 
 #endif /* CHOOSE_H */