From bf6e7073bb05741c865cf9efee9ec387acdee4b9 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 18 Dec 2006 12:35:02 +0000 Subject: Show favicons in location entry drop-down. Bug #112748, patch by Diego 2006-12-18 Christian Persch * lib/widgets/ephy-location-entry.c: (ephy_location_entry_set_completion): * lib/widgets/ephy-location-entry.h: * src/ephy-completion-model.c: (ephy_completion_model_get_column_type), (init_favicon_col), (ephy_completion_model_get_value): * src/ephy-completion-model.h: * src/ephy-location-action.c: (connect_proxy): Show favicons in location entry drop-down. Bug #112748, patch by Diego Escalante Urrelo. --- lib/widgets/ephy-location-entry.c | 15 +++++++++++++-- lib/widgets/ephy-location-entry.h | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index 77f5d7514..0455786ea 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -76,6 +77,7 @@ struct _EphyLocationEntryPrivate guint keywords_col; guint relevance_col; guint extra_col; + guint favicon_col; guint hash; @@ -999,18 +1001,20 @@ ephy_location_entry_set_completion (EphyLocationEntry *le, guint action_col, guint keywords_col, guint relevance_col, - guint extra_col) + guint extra_col, + guint favicon_col) { EphyLocationEntryPrivate *priv = le->priv; GtkTreeModel *sort_model; GtkEntryCompletion *completion; - GtkCellRenderer *cell, *extracell; + GtkCellRenderer *cell, *extracell, *iconcell; le->priv->text_col = text_col; le->priv->action_col = action_col; le->priv->keywords_col = keywords_col; le->priv->relevance_col = relevance_col; le->priv->extra_col = extra_col; + le->priv->favicon_col = favicon_col; sort_model = gtk_tree_model_sort_new_with_model (model); g_object_unref (model); @@ -1027,6 +1031,13 @@ ephy_location_entry_set_completion (EphyLocationEntry *le, g_signal_connect_after (completion, "action-activated", G_CALLBACK (action_activated_after_cb), le); + iconcell = gtk_cell_renderer_pixbuf_new (); + + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (completion), + iconcell, FALSE); + gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (completion), + iconcell, "pixbuf", favicon_col); + cell = gtk_cell_renderer_text_new (); g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_END, diff --git a/lib/widgets/ephy-location-entry.h b/lib/widgets/ephy-location-entry.h index cdd02130f..3f188260f 100644 --- a/lib/widgets/ephy-location-entry.h +++ b/lib/widgets/ephy-location-entry.h @@ -72,7 +72,8 @@ void ephy_location_entry_set_completion (EphyLocationEntry *le, guint action_col, guint keywords_col, guint relevance_col, - guint extra_col); + guint extra_col, + guint favicon_col); void ephy_location_entry_set_location (EphyLocationEntry *le, const char *address, -- cgit v1.2.3