diff options
author | Felix Kaser <f.kaser@gmx.net> | 2010-07-28 20:59:06 +0800 |
---|---|---|
committer | Felix Kaser <f.kaser@gmx.net> | 2010-07-29 21:48:13 +0800 |
commit | 673b6d90189c65ef4d859e2a3139ce7c0cea1e49 (patch) | |
tree | 44dfcedf37e028996109b5e1d0272a84693930b8 | |
parent | f49028633f80ab1c641f29f85ae39e2184894f93 (diff) | |
download | gsoc2013-empathy-673b6d90189c65ef4d859e2a3139ce7c0cea1e49.tar gsoc2013-empathy-673b6d90189c65ef4d859e2a3139ce7c0cea1e49.tar.gz gsoc2013-empathy-673b6d90189c65ef4d859e2a3139ce7c0cea1e49.tar.bz2 gsoc2013-empathy-673b6d90189c65ef4d859e2a3139ce7c0cea1e49.tar.lz gsoc2013-empathy-673b6d90189c65ef4d859e2a3139ce7c0cea1e49.tar.xz gsoc2013-empathy-673b6d90189c65ef4d859e2a3139ce7c0cea1e49.tar.zst gsoc2013-empathy-673b6d90189c65ef4d859e2a3139ce7c0cea1e49.zip |
add key navigation possibilities to search
one result of this patch is that key navigation in the search-entry will not be possible any more, in order to allow the hook widget to react to key navigation.
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index dceae87fa..82d156265 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -1284,6 +1284,25 @@ individual_view_search_activate_cb (GtkWidget *search, } static void +individual_view_search_key_navigation_cb (GtkWidget *search, + gpointer eventkey, + EmpathyIndividualView *view) +{ + GdkEventKey *event = ((GdkEventKey *) eventkey); + if (event->keyval == GDK_Up || event->keyval == GDK_Down) + { + GdkEvent *new_event; + + new_event = gdk_event_copy ((GdkEvent *) event); + gtk_widget_grab_focus (GTK_WIDGET (view)); + gtk_widget_event (GTK_WIDGET (view), new_event); + gtk_widget_grab_focus (search); + + gdk_event_free (new_event); + } +} + +static void individual_view_search_hide_cb (EmpathyLiveSearch *search, EmpathyIndividualView *view) { @@ -2144,6 +2163,8 @@ empathy_individual_view_set_live_search (EmpathyIndividualView *view, g_signal_handlers_disconnect_by_func (priv->search_widget, individual_view_search_activate_cb, view); g_signal_handlers_disconnect_by_func (priv->search_widget, + individual_view_search_key_navigation_cb, view); + g_signal_handlers_disconnect_by_func (priv->search_widget, individual_view_search_hide_cb, view); g_signal_handlers_disconnect_by_func (priv->search_widget, individual_view_search_show_cb, view); @@ -2163,6 +2184,8 @@ empathy_individual_view_set_live_search (EmpathyIndividualView *view, G_CALLBACK (individual_view_search_text_notify_cb), view); g_signal_connect (priv->search_widget, "activate", G_CALLBACK (individual_view_search_activate_cb), view); + g_signal_connect (priv->search_widget, "key-navigation", + G_CALLBACK (individual_view_search_key_navigation_cb), view); g_signal_connect (priv->search_widget, "hide", G_CALLBACK (individual_view_search_hide_cb), view); g_signal_connect (priv->search_widget, "show", |