Index: ephy-favicon-action.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-favicon-action.c,v
retrieving revision 1.20
diff -u -p -r1.20 ephy-favicon-action.c
--- ephy-favicon-action.c	18 Sep 2003 17:06:35 -0000	1.20
+++ ephy-favicon-action.c	27 Oct 2003 14:09:37 -0000
@@ -24,12 +24,15 @@
 #include "ephy-dnd.h"
 #include "ephy-favicon-cache.h"
 #include "ephy-shell.h"
+#include "ephy-file-helpers.h"
 #include "ephy-debug.h"
 
+#include <gtk/gtkbox.h>
+#include <gtk/gtkhbox.h>
+#include <gtk/gtkeventbox.h>
 #include <gtk/gtktoolitem.h>
 #include <gtk/gtkimage.h>
 #include <gtk/gtkstock.h>
-#include <gtk/gtkeventbox.h>
 
 static GtkTargetEntry url_drag_types [] =
 {
@@ -44,15 +47,17 @@ static int n_url_drag_types = G_N_ELEMEN
 struct EphyFaviconActionPrivate
 {
 	EphyWindow *window;
-	char *icon;
 	EphyFaviconCache *cache;
+	char *icon;
+	gboolean spinning;
 };
 
 enum
 {
 	PROP_0,
-	PROP_WINDOW,
-	PROP_ICON
+	PROP_ICON,
+	PROP_SPINNING,
+	PROP_WINDOW
 };
 
 static void ephy_favicon_action_init       (EphyFaviconAction *action);
@@ -130,22 +135,34 @@ favicon_drag_data_get_cb (GtkWidget *wid
 static GtkWidget *
 create_tool_item (GtkAction *action)
 {
-	GtkWidget *image;
-	GtkWidget *ebox;
-	GtkWidget *item;
+	GtkWidget *image, *spinner, *ebox, *hbox, *item;
+	GdkPixbufAnimation *loading_pixbuf;
 
 	item = GTK_WIDGET (gtk_tool_item_new ());
 
+	/* setup drag event window */
 	ebox = gtk_event_box_new ();
 	gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE);
-	image = gtk_image_new ();
-	gtk_container_add (GTK_CONTAINER (ebox), image);
 	gtk_container_set_border_width (GTK_CONTAINER (ebox), 2);
 	gtk_container_add (GTK_CONTAINER (item), ebox);
-	gtk_widget_show (image);
 	gtk_widget_show (ebox);
+	hbox = gtk_hbox_new (FALSE, 0);
+	gtk_container_add (GTK_CONTAINER (ebox), hbox);
+	gtk_widget_show (hbox);
+
+	/* setup site icon */
+	image = gtk_image_new ();
+	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+
+	/* setup load feedback image */
+	/* FIXME: make the animation themeable */
+	loading_pixbuf = gdk_pixbuf_animation_new_from_file (ephy_file ("epiphany-tab-loading.gif"), NULL);
+	spinner = gtk_image_new_from_animation (loading_pixbuf);
+	g_object_unref (loading_pixbuf);
+	gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0);
 
 	g_object_set_data (G_OBJECT (item), "image", image);
+	g_object_set_data (G_OBJECT (item), "spinner", spinner);
 
 	gtk_drag_source_set (ebox,
                              GDK_BUTTON1_MASK,
@@ -191,6 +208,28 @@ ephy_favicon_action_sync_icon (GtkAction
 }
 
 static void
+ephy_favicon_action_sync_spinning (GtkAction *gaction, GParamSpec *pspec,
+				   GtkWidget *proxy)
+{
+	EphyFaviconAction *action = EPHY_FAVICON_ACTION (gaction);
+	GtkWidget *icon, *spinner;
+
+	icon = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "image"));
+	spinner = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "spinner"));
+
+	if (action->priv->spinning)
+	{
+		gtk_widget_hide (icon);
+		gtk_widget_show (spinner);
+	}
+	else
+	{
+		gtk_widget_hide (spinner);
+		gtk_widget_show (icon);
+	}
+}
+
+static void
 connect_proxy (GtkAction *action, GtkWidget *proxy)
 {
 	ephy_favicon_action_sync_icon (action, NULL, proxy);
@@ -198,6 +237,10 @@ connect_proxy (GtkAction *action, GtkWid
 				 G_CALLBACK (ephy_favicon_action_sync_icon),
 				 proxy, 0);
 
+	g_signal_connect_object (action, "notify::spinning",
+				 G_CALLBACK (ephy_favicon_action_sync_spinning),
+				 proxy, 0);
+
 	(* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy);
 }
 
@@ -219,7 +262,11 @@ ephy_favicon_action_set_property (GObjec
 		case PROP_ICON:
 			g_free (fav->priv->icon);
 			fav->priv->icon = g_strdup (g_value_get_string (value));
-			g_object_notify(object, "icon");
+			g_object_notify (object, "icon");
+			break;
+		case PROP_SPINNING:
+			fav->priv->spinning = g_value_get_boolean (value);
+			g_object_notify (object, "spinning");
 			break;
 	}
 }
@@ -242,6 +289,8 @@ ephy_favicon_action_get_property (GObjec
 		case PROP_ICON:
 			g_value_set_object (value, fav->priv->icon);
 			break;
+		case PROP_SPINNING:
+			g_value_set_boolean (value, fav->priv->spinning);
 	}
 }
 
@@ -276,6 +325,13 @@ ephy_favicon_action_class_init (EphyFavi
                                                                "The icon",
                                                                NULL,
                                                                G_PARAM_READWRITE));
+	g_object_class_install_property (object_class,
+					 PROP_SPINNING,
+					 g_param_spec_boolean ("spinning",
+							       "Spinning",
+							       "Spinning",
+							       FALSE,
+							       G_PARAM_READWRITE));
 
 	g_type_class_add_private (object_class, sizeof(EphyFaviconActionPrivate));
 }
@@ -286,6 +342,7 @@ ephy_favicon_action_init (EphyFaviconAct
 	action->priv = EPHY_FAVICON_ACTION_GET_PRIVATE (action);
 
 	action->priv->icon = NULL;
+	action->priv->spinning = FALSE;
 
 	action->priv->cache = EPHY_FAVICON_CACHE
 		(ephy_embed_shell_get_favicon_cache
Index: toolbar.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/toolbar.c,v
retrieving revision 1.70
diff -u -p -r1.70 toolbar.c
--- toolbar.c	27 Oct 2003 08:13:36 -0000	1.70
+++ toolbar.c	27 Oct 2003 14:09:38 -0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2000 Marco Pesenti Gritti
+ *  Copyright (C) 2000-2003 Marco Pesenti Gritti
  *  Copyright (C) 2001, 2002 Jorn Baayen
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -20,7 +20,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
 #endif
 
 #include "toolbar.h"
@@ -601,13 +601,27 @@ toolbar_activate_location (Toolbar *t)
 void
 toolbar_spinner_start (Toolbar *t)
 {
+	GtkActionGroup *action_group;
+	GtkAction *action;
+
 	ephy_spinner_start (EPHY_SPINNER (t->priv->spinner));
+
+	action_group = t->priv->action_group;
+	action = gtk_action_group_get_action (action_group, "Favicon");
+	g_object_set (G_OBJECT (action), "spinning", TRUE, NULL);
 }
 
 void
 toolbar_spinner_stop (Toolbar *t)
 {
+	GtkActionGroup *action_group;
+	GtkAction *action;
+
 	ephy_spinner_stop (EPHY_SPINNER (t->priv->spinner));
+
+	action_group = t->priv->action_group;
+	action = gtk_action_group_get_action (action_group, "Favicon");
+	g_object_set (G_OBJECT (action), "spinning", FALSE, NULL);
 }
 
 void
