diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-21 06:09:34 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-21 06:09:34 +0800 |
commit | 5d12f06367a0939387381f66cea77766a873aea6 (patch) | |
tree | 221b29a45e7e52481a4638d12cdf8e8253bb9ce1 /mail/em-message-browser.c | |
parent | 23f58b3f17ce7ba08a8bd3f6066f62f0f454bacf (diff) | |
download | gsoc2013-evolution-5d12f06367a0939387381f66cea77766a873aea6.tar.gz gsoc2013-evolution-5d12f06367a0939387381f66cea77766a873aea6.tar.zst gsoc2013-evolution-5d12f06367a0939387381f66cea77766a873aea6.zip |
Bug 580925 – Better search bar for word searches
Make the word search bar more like Firefox and get rid of the "Current
Message" search scope in the folder search bar. Shift+Ctrl+F now
activates the word search bar.
Diffstat (limited to 'mail/em-message-browser.c')
-rw-r--r-- | mail/em-message-browser.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/mail/em-message-browser.c b/mail/em-message-browser.c index 728b27ec43..973708bc2b 100644 --- a/mail/em-message-browser.c +++ b/mail/em-message-browser.c @@ -48,6 +48,7 @@ #include "e-util/e-util-private.h" +#include "e-mail-search-bar.h" #include "em-format-html-display.h" #include "em-message-browser.h" #include "em-menu.h" @@ -63,6 +64,7 @@ struct _EMMessageBrowserPrivate { GtkWidget *preview; /* container for message display */ + GtkWidget *search_bar; }; static gpointer parent_class; @@ -225,6 +227,14 @@ emmb_destroy (GtkObject *gtk_object) } static void +emmb_show_search_bar (EMFolderView *folder_view) +{ + EMMessageBrowser *browser = EM_MESSAGE_BROWSER (folder_view); + + gtk_widget_show (browser->priv->search_bar); +} + +static void emmb_class_init (EMMessageBrowserClass *class) { GtkObjectClass *gtk_object_class; @@ -240,12 +250,14 @@ emmb_class_init (EMMessageBrowserClass *class) folder_view_class->update_message_style = FALSE; folder_view_class->set_message = emmb_set_message; folder_view_class->activate = emmb_activate; + folder_view_class->show_search_bar = emmb_show_search_bar; } static void emmb_init (EMMessageBrowser *emmb) { EMFolderView *emfv = EM_FOLDER_VIEW (emmb); + GtkWidget *container; GtkWidget *widget; gchar *filename; @@ -265,25 +277,35 @@ emmb_init (EMMessageBrowser *emmb) EVOLUTION_UIDIR, "evolution-mail-message.xml", NULL); emfv->ui_files = g_slist_append (emfv->ui_files, filename); + gtk_box_set_spacing (GTK_BOX (emmb), 1); + + container = GTK_WIDGET (emmb); + widget = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW (widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); - gtk_widget_show (widget); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); emmb->priv->preview = widget; + gtk_widget_show (widget); + + widget = e_mail_search_bar_new (emfv->preview->formathtml.html); + gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); + emmb->priv->search_bar = widget; + gtk_widget_hide (widget); + + g_signal_connect_swapped ( + widget, "changed", + G_CALLBACK (em_format_redraw), emfv->preview); + + container = emmb->priv->preview; widget = GTK_WIDGET (emfv->preview->formathtml.html); - gtk_container_add (GTK_CONTAINER (emmb->priv->preview), widget); + gtk_container_add (GTK_CONTAINER (container), widget); gtk_widget_show (widget); - gtk_box_pack_start ( - GTK_BOX (emmb), emmb->priv->preview, TRUE, TRUE, 0); - gtk_box_pack_start( - GTK_BOX (emmb), em_format_html_get_search_dialog ( - emfv->preview), FALSE, FALSE, 0); - /** @HookPoint-EMMenu: Standalone Message View Menu * @Id: org.gnome.evolution.mail.messagebrowser * @Class: org.gnome.evolution.mail.bonobomenu:1.0 |