]> spindle.queued.net Git - midori/commitdiff
Render search engine icons via the action
authorChristian Dywan <christian@twotoasts.de>
Sun, 1 May 2011 16:49:09 +0000 (18:49 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 1 May 2011 16:49:09 +0000 (18:49 +0200)
midori/midori-browser.c
midori/midori-locationaction.c
midori/midori-searchaction.c
midori/midori-searchaction.h
midori/midori-view.c

index 9f528279590716d7ad1efb28296b45a6cb2aae2c..3b01e88014e4383d49a0274096ef89ab8e47369e 100644 (file)
@@ -215,11 +215,6 @@ static void
 midori_browser_set_bookmarks (MidoriBrowser* browser,
                               KatzeArray*    bookmarks);
 
-GdkPixbuf*
-midori_search_action_get_icon (KatzeItem*    item,
-                               GtkWidget*    widget,
-                               const gchar** icon_name);
-
 static void
 midori_browser_add_speed_dial (MidoriBrowser* browser);
 
index 8e796c55a535aaaac5ce1dea9ba82051783602b2..b56fb77bd4d306ad51498a295f6c93938d07ceef 100644 (file)
@@ -16,6 +16,7 @@
 #include "marshal.h"
 #include "sokoke.h"
 #include "midori-browser.h"
+#include "midori-searchaction.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
@@ -497,13 +498,15 @@ midori_location_action_popup_timeout_cb (gpointer data)
         {
             gchar* uri;
             gchar* title;
+            GdkPixbuf* icon;
 
             uri = sokoke_search_uri (katze_item_get_uri (item), action->key);
             title = g_strdup_printf (_("Search with %s"), katze_item_get_name (item));
+            icon = midori_search_action_get_icon (item, action->treeview, NULL, FALSE);
             gtk_list_store_insert_with_values (store, NULL, matches + i,
                 URI_COL, uri, TITLE_COL, title, YALIGN_COL, 0.25,
                 BACKGROUND_COL, style ? &style->bg[GTK_STATE_NORMAL] : NULL,
-                STYLE_COL, 1, FAVICON_COL, NULL, -1);
+                STYLE_COL, 1, FAVICON_COL, icon, -1);
             g_free (uri);
             g_free (title);
             i++;
index 279ddb0d41617aa51137d50a00e4763905a6be8d..e55fb774aba51ca8563576f41e3dd1faf5c73fda 100644 (file)
@@ -399,8 +399,7 @@ midori_search_action_manage_activate_cb (GtkWidget*          menuitem,
         gtk_widget_show (dialog);
 }
 
-/* Private function, used by MidoriView */
-/* static */ GdkPixbuf*
+GdkPixbuf*
 midori_search_action_get_icon (KatzeItem*    item,
                                GtkWidget*    widget,
                                const gchar** icon_name,
index 9eb269f442b58fe52640c3add072dc2f7134f50b..c8d0ed88a87cc3fac758f291287eecad927f6c1b 100644 (file)
@@ -59,6 +59,12 @@ midori_search_action_set_current_item      (MidoriSearchAction* search_action,
 KatzeItem*
 midori_search_action_get_default_item      (MidoriSearchAction* search_action);
 
+GdkPixbuf*
+midori_search_action_get_icon              (KatzeItem*          item,
+                                            GtkWidget*          widget,
+                                            const gchar** icon_name,
+                                            gboolean      in_entry);
+
 void
 midori_search_action_set_default_item      (MidoriSearchAction* search_action,
                                             KatzeItem*          item);
index b96377ed1d8e336bf8c1d6a131236a3a683986d8..9b26ec7558e881444b7effbc024aefd10e1a8b43 100644 (file)
@@ -17,6 +17,7 @@
 #include "midori-view.h"
 #include "midori-stock.h"
 #include "midori-browser.h"
+#include "midori-searchaction.h"
 
 #include "marshal.h"
 #include "sokoke.h"
@@ -46,11 +47,6 @@ void
 webkit_web_frame_print (WebKitWebFrame* web_frame);
 #endif
 
-GdkPixbuf*
-midori_search_action_get_icon (KatzeItem*    item,
-                               GtkWidget*    widget,
-                               const gchar** icon_name);
-
 static void
 midori_view_construct_web_view (MidoriView* view);
 
@@ -2624,7 +2620,7 @@ midori_view_populate_popup (MidoriView* view,
 
                 menuitem = gtk_image_menu_item_new_with_mnemonic (katze_item_get_name (item));
                 pixbuf = midori_search_action_get_icon (item,
-                    GTK_WIDGET (web_view), &icon_name);
+                    GTK_WIDGET (web_view), &icon_name, FALSE);
                 if (pixbuf)
                 {
                     icon = gtk_image_new_from_pixbuf (pixbuf);