[empathy] add key navigation possibilities to search
- From: Felix Kaser <kaserf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] add key navigation possibilities to search
- Date: Thu, 29 Jul 2010 15:08:42 +0000 (UTC)
commit 673b6d90189c65ef4d859e2a3139ce7c0cea1e49
Author: Felix Kaser <f kaser gmx net>
Date: Wed Jul 28 14:59:06 2010 +0200
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.
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 dceae87..82d1562 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",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]