aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorLi Yuan <li.yuan@sun.com>2006-08-21 16:09:25 +0800
committerLi Yuan <liyuan@src.gnome.org>2006-08-21 16:09:25 +0800
commit9fde25b2d539b670a743ce8789369689f3ad1779 (patch)
tree03802dbc3862b427442bedf0578f5cc888b33165 /widgets
parent781aa2407ff6c8a11fd364dcaf48d55163ae1780 (diff)
downloadgsoc2013-evolution-9fde25b2d539b670a743ce8789369689f3ad1779.tar
gsoc2013-evolution-9fde25b2d539b670a743ce8789369689f3ad1779.tar.gz
gsoc2013-evolution-9fde25b2d539b670a743ce8789369689f3ad1779.tar.bz2
gsoc2013-evolution-9fde25b2d539b670a743ce8789369689f3ad1779.tar.lz
gsoc2013-evolution-9fde25b2d539b670a743ce8789369689f3ad1779.tar.xz
gsoc2013-evolution-9fde25b2d539b670a743ce8789369689f3ad1779.tar.zst
gsoc2013-evolution-9fde25b2d539b670a743ce8789369689f3ad1779.zip
** Fixes bug #348753
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. svn path=/trunk/; revision=32611
Diffstat (limited to 'widgets')
-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);