diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-05-20 21:32:33 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2011-05-20 21:48:13 +0800 |
commit | c105d23a6dc033e281304a0032095f13e7fef63f (patch) | |
tree | c5386fdb2bd980490f649b9a8e8c20757ae6828d /libempathy-gtk/empathy-live-search.c | |
parent | 584931b9c50f9390ba19d8609ac9917b570d6562 (diff) | |
download | gsoc2013-empathy-c105d23a6dc033e281304a0032095f13e7fef63f.tar gsoc2013-empathy-c105d23a6dc033e281304a0032095f13e7fef63f.tar.gz gsoc2013-empathy-c105d23a6dc033e281304a0032095f13e7fef63f.tar.bz2 gsoc2013-empathy-c105d23a6dc033e281304a0032095f13e7fef63f.tar.lz gsoc2013-empathy-c105d23a6dc033e281304a0032095f13e7fef63f.tar.xz gsoc2013-empathy-c105d23a6dc033e281304a0032095f13e7fef63f.tar.zst gsoc2013-empathy-c105d23a6dc033e281304a0032095f13e7fef63f.zip |
live-search: fix keyboard navigation using Home/End (#632787)
Diffstat (limited to 'libempathy-gtk/empathy-live-search.c')
-rw-r--r-- | libempathy-gtk/empathy-live-search.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-live-search.c b/libempathy-gtk/empathy-live-search.c index 7296eb7c6..21aefed90 100644 --- a/libempathy-gtk/empathy-live-search.c +++ b/libempathy-gtk/empathy-live-search.c @@ -276,6 +276,16 @@ live_search_entry_key_pressed_cb (GtkEntry *entry, return fire_key_navigation_sig (self, event); } + if (event->keyval == GDK_KEY_Home || event->keyval == GDK_KEY_End) + { + /* If the live search is visible, the entry should catch the Home/End + * events */ + if (!gtk_widget_get_visible (GTK_WIDGET (self))) + { + return fire_key_navigation_sig (self, event); + } + } + return FALSE; } @@ -342,6 +352,14 @@ live_search_key_press_event_cb (GtkWidget *widget, if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down) return FALSE; + if (event->keyval == GDK_KEY_Home || event->keyval == GDK_KEY_End) + { + /* Home/End keys have to be forwarded to the entry only if the live + * search is visible (to move the cursor inside the entry). */ + if (!gtk_widget_get_visible (GTK_WIDGET (self))) + return FALSE; + } + /* realize the widget if it is not realized yet */ gtk_widget_realize (priv->search_entry); if (!gtk_widget_has_focus (priv->search_entry)) |