aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/misc/ChangeLog7
-rw-r--r--widgets/misc/e-search-bar.c17
2 files changed, 24 insertions, 0 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 99adcbd354..b0eba3ff6c 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,10 @@
+2006-08-21 Li Yuan <li.yuan@sun.com>
+
+ ** Fixes bug #348753
+
+ * e-search-bar.c: (entry_key_press_cb), (e_search_bar_construct):
+ Add accelerate key to the search bar. <ALT ARROW_DOWN> open option window.
+
2006-08-21 Srinivasa Ragavan <sragavan@novell.com>
* e-filter-bar.c: (rule_editor_destroyed),
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index 430b12aa2f..85ce98217a 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -29,6 +29,7 @@
#include <config.h>
#endif
+#include <gdk/gdkkeysyms.h>
#include <gtk/gtkdrawingarea.h>
#include <gtk/gtkeventbox.h>
#include <gtk/gtkmenuitem.h>
@@ -481,6 +482,20 @@ clear_button_clicked_cb (GtkWidget *widget, GdkEventButton *event,
gtk_widget_grab_focus (esb->entry);
}
+static gboolean
+entry_key_press_cb (GtkWidget *widget,
+ GdkEventKey *key_event,
+ ESearchBar *esb)
+{
+ if (((key_event->state & gtk_accelerator_get_default_mod_mask ()) ==
+ GDK_MOD1_MASK) && (key_event->keyval == GDK_Down)) {
+ option_button_clicked_cb (NULL, NULL, esb);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
scopeoption_changed_cb (GtkWidget *option_menu, ESearchBar *search_bar)
{
@@ -932,6 +947,8 @@ e_search_bar_construct (ESearchBar *search_bar,
G_CALLBACK (entry_focus_in_cb), search_bar);
g_signal_connect (search_bar->entry, "focus-out-event",
G_CALLBACK (entry_focus_out_cb), search_bar);
+ g_signal_connect (search_bar->entry, "key-press-event",
+ G_CALLBACK (entry_key_press_cb), search_bar);
search_bar->clear_button = e_icon_entry_create_button ("gtk-clear");
g_signal_connect (G_OBJECT (search_bar->clear_button), "button-press-event", clear_button_clicked_cb, search_bar);