diff options
author | Thomas Meire <blackskad@gmail.com> | 2010-01-12 23:34:39 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-01-12 23:36:01 +0800 |
commit | 0ee842ac627f30fa14d75b06cd7147a67090731e (patch) | |
tree | fb0732e13d95ca15fa7a0ad29d88b3c26d95c3e8 /libempathy-gtk/empathy-chat.c | |
parent | 183fa2e8a94d94a7098120fc43cde9ad83869de6 (diff) | |
download | gsoc2013-empathy-0ee842ac627f30fa14d75b06cd7147a67090731e.tar gsoc2013-empathy-0ee842ac627f30fa14d75b06cd7147a67090731e.tar.gz gsoc2013-empathy-0ee842ac627f30fa14d75b06cd7147a67090731e.tar.bz2 gsoc2013-empathy-0ee842ac627f30fa14d75b06cd7147a67090731e.tar.lz gsoc2013-empathy-0ee842ac627f30fa14d75b06cd7147a67090731e.tar.xz gsoc2013-empathy-0ee842ac627f30fa14d75b06cd7147a67090731e.tar.zst gsoc2013-empathy-0ee842ac627f30fa14d75b06cd7147a67090731e.zip |
Add search bar in chat text views (#585168)
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 02d123b54..95e9ecbc5 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -48,6 +48,7 @@ #include "empathy-contact-list-store.h" #include "empathy-contact-list-view.h" #include "empathy-contact-menu.h" +#include "empathy-search-bar.h" #include "empathy-theme-manager.h" #include "empathy-smiley-manager.h" #include "empathy-ui-utils.h" @@ -93,6 +94,7 @@ typedef struct { GtkWidget *label_topic; GtkWidget *contact_list_view; GtkWidget *info_bar_vbox; + GtkWidget *search_bar; guint unread_messages; /* TRUE if the pending messages can be displayed. This is to avoid to show @@ -1369,6 +1371,11 @@ chat_input_key_press_event_cb (GtkWidget *widget, gtk_adjustment_set_value (adj, val); return TRUE; } + /* catch ctrl-f to display the search bar */ + if ((event->state & GDK_CONTROL_MASK) && (event->keyval == GDK_f)) { + empathy_search_bar_show (EMPATHY_SEARCH_BAR (priv->search_bar)); + return TRUE; + } if (!(event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) && event->keyval == GDK_Tab) { GtkTextBuffer *buffer; @@ -2135,6 +2142,13 @@ chat_create_ui (EmpathyChat *chat) chat->input_text_view); gtk_widget_show (chat->input_text_view); + /* Add the (invisible) search bar */ + priv->search_bar = empathy_search_bar_new (chat->view); + gtk_box_pack_start (GTK_BOX(priv->vbox_left), + priv->search_bar, + FALSE, FALSE, 0); + gtk_box_reorder_child (GTK_BOX(priv->vbox_left), priv->search_bar, 1); + /* Initialy hide the topic, will be shown if not empty */ gtk_widget_hide (priv->hbox_topic); @@ -2150,7 +2164,8 @@ chat_create_ui (EmpathyChat *chat) gtk_paned_set_position (GTK_PANED(priv->hpaned), paned_pos); /* Set widget focus order */ - list = g_list_append (NULL, priv->scrolled_window_input); + list = g_list_append (NULL, priv->search_bar); + list = g_list_append (list, priv->scrolled_window_input); gtk_container_set_focus_chain (GTK_CONTAINER (priv->vbox_left), list); g_list_free (list); |