[epiphany] ephy-find-toolbar: Close the search bar when loading new page in the current tab



commit 78b0f5ad9292edeb872bc8f418d6bc24804208fd
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Mon Dec 9 13:37:04 2013 +0200

    ephy-find-toolbar: Close the search bar when loading new page in the current tab
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710542

 embed/ephy-find-toolbar.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-find-toolbar.c b/embed/ephy-find-toolbar.c
index 4f80fe5..c132311 100644
--- a/embed/ephy-find-toolbar.c
+++ b/embed/ephy-find-toolbar.c
@@ -428,6 +428,18 @@ search_entry_changed_cb (GtkEntry *entry,
 }
 
 static void
+ephy_find_toolbar_load_changed_cb (WebKitWebView   *web_view,
+                                  WebKitLoadEvent  load_event,
+                                  EphyFindToolbar *toolbar)
+{
+       if (load_event == WEBKIT_LOAD_STARTED &&
+           gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (toolbar)))
+       {
+               ephy_find_toolbar_close (toolbar);
+       }
+}
+
+static void
 ephy_find_toolbar_init (EphyFindToolbar *toolbar)
 {
        EphyFindToolbarPrivate *priv;
@@ -648,6 +660,9 @@ ephy_find_toolbar_set_web_view (EphyFindToolbar *toolbar,
                 g_signal_connect_object (priv->controller, "failed-to-find-text",
                                          G_CALLBACK (failed_to_find_text_cb),
                                          toolbar, 0);
+                g_signal_connect (web_view, "load-changed",
+                                 G_CALLBACK (ephy_find_toolbar_load_changed_cb),
+                                 toolbar);
 
                clear_status (toolbar);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]