Render search engine icons via the action

This commit is contained in:
Christian Dywan 2011-05-01 18:49:09 +02:00
parent 1636644829
commit 4bab11061c
5 changed files with 13 additions and 14 deletions

View 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);

View 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++;

View 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,

View 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);

View 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);