]> spindle.queued.net Git - midori/commitdiff
Activating Search if hidden should spawn the search page
authorChristian Dywan <christian@twotoasts.de>
Wed, 29 Apr 2009 22:43:47 +0000 (00:43 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 29 Apr 2009 22:43:47 +0000 (00:43 +0200)
midori/midori-browser.c

index 041643a5391f92555a1e34c2258ad2f0f1feb9eb..50613fd0ffe73c1c2b17879812d65a5515d8f16a 100644 (file)
@@ -2650,14 +2650,6 @@ _action_location_secondary_icon_released (GtkAction*     action,
     }
 }
 
-static void
-_action_search_activate (GtkAction*     action,
-                         MidoriBrowser* browser)
-{
-    if (!GTK_WIDGET_VISIBLE (browser->navigationbar))
-        gtk_widget_show (browser->navigationbar);
-}
-
 static void
 _action_search_submit (GtkAction*     action,
                        const gchar*   keywords,
@@ -2686,6 +2678,24 @@ _action_search_submit (GtkAction*     action,
     g_free (search);
 }
 
+static void
+_action_search_activate (GtkAction*     action,
+                         MidoriBrowser* browser)
+{
+    GSList* proxies = gtk_action_get_proxies (action);
+    guint i = 0;
+    GtkWidget* proxy;
+    while (((proxy = g_slist_nth_data (proxies, i++))))
+        if (GTK_IS_TOOL_ITEM (proxy))
+        {
+            if (!GTK_WIDGET_VISIBLE (browser->navigationbar))
+                gtk_widget_show (browser->navigationbar);
+            return;
+        }
+    _action_search_submit (action, "", FALSE, browser);
+    gtk_widget_grab_focus (midori_browser_get_current_tab (browser));
+}
+
 static void
 _action_search_notify_current_item (GtkAction*     action,
                                     GParamSpec*    pspec,