diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-07-03 05:59:32 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-07-03 05:59:32 +0800 |
commit | b597caf899ec8778d8302f6ccce3a01651bb1b25 (patch) | |
tree | 2cc52a6d042ff50072e6ed7f0779ec3b5a5bbe4e /src | |
parent | d7a633cd5f758d3812959fe562dd2dd35b275c1e (diff) | |
download | gsoc2013-epiphany-b597caf899ec8778d8302f6ccce3a01651bb1b25.tar gsoc2013-epiphany-b597caf899ec8778d8302f6ccce3a01651bb1b25.tar.gz gsoc2013-epiphany-b597caf899ec8778d8302f6ccce3a01651bb1b25.tar.bz2 gsoc2013-epiphany-b597caf899ec8778d8302f6ccce3a01651bb1b25.tar.lz gsoc2013-epiphany-b597caf899ec8778d8302f6ccce3a01651bb1b25.tar.xz gsoc2013-epiphany-b597caf899ec8778d8302f6ccce3a01651bb1b25.tar.zst gsoc2013-epiphany-b597caf899ec8778d8302f6ccce3a01651bb1b25.zip |
R data/art/epiphany-tab-loading.gif:
2004-07-02 Christian Persch <chpe@cvs.gnome.org>
* data/art/Makefile.am:
R data/art/epiphany-tab-loading.gif:
* lib/widgets/ephy-spinner.c: (get_spinner_dimensions),
(ephy_spinner_init), (ephy_spinner_expose),
(ephy_spinner_unload_images), (scale_to_real_size),
(ephy_spinner_set_size), (ephy_spinner_size_request):
* lib/widgets/ephy-spinner.h:
* src/ephy-notebook.c: (sync_load_status), (build_tab_label):
* src/toolbar.c: (fixed_toolbar_reconfigured_cb), (toolbar_init):
Remove our tab loading animation and use mini-spinners instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-notebook.c | 47 | ||||
-rwxr-xr-x | src/toolbar.c | 43 |
2 files changed, 36 insertions, 54 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index cbe261eb0..e09543f72 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -36,6 +36,7 @@ #include "ephy-debug.h" #include "ephy-favicon-cache.h" #include "ephy-ellipsizing-label.h" +#include "ephy-spinner.h" #include <glib-object.h> #include <gtk/gtkeventbox.h> @@ -727,22 +728,23 @@ ephy_notebook_finalize (GObject *object) static void sync_load_status (EphyTab *tab, GParamSpec *pspec, GtkWidget *proxy) { - GtkWidget *animation = NULL, *icon = NULL; + GtkWidget *spinner, *icon; - animation = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "loading-image")); + spinner = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "spinner")); icon = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "icon")); - g_return_if_fail (animation != NULL && icon != NULL); + g_return_if_fail (spinner != NULL && icon != NULL); - switch (ephy_tab_get_load_status (tab)) + if (ephy_tab_get_load_status (tab)) { - case TRUE: - gtk_widget_hide (icon); - gtk_widget_show (animation); - break; - case FALSE: - gtk_widget_hide (animation); - gtk_widget_show (icon); - break; + gtk_widget_hide (icon); + gtk_widget_show (spinner); + ephy_spinner_start (EPHY_SPINNER (spinner)); + } + else + { + ephy_spinner_stop (EPHY_SPINNER (spinner)); + gtk_widget_hide (spinner); + gtk_widget_show (icon); } } @@ -841,12 +843,9 @@ tab_label_style_set_cb (GtkWidget *label, static GtkWidget * build_tab_label (EphyNotebook *nb, EphyTab *tab) { - GtkWidget *label, *hbox, *label_hbox, *close_button, *image; - int h, w; - GtkWidget *window; - GtkWidget *loading_image, *icon; - GtkWidget *label_ebox; - GdkPixbufAnimation *loading_pixbuf; + GtkWidget *window, *hbox, *label_hbox, *label_ebox; + GtkWidget *label, *close_button, *image, *spinner, *icon; + int h = -1, w = -1; window = gtk_widget_get_toplevel (GTK_WIDGET (nb)); @@ -877,12 +876,10 @@ build_tab_label (EphyNotebook *nb, EphyTab *tab) G_CALLBACK (close_button_clicked_cb), tab); - /* setup load feedback image */ - /* FIXME: make the animation themeable */ - loading_pixbuf = gdk_pixbuf_animation_new_from_file (ephy_file ("epiphany-tab-loading.gif"), NULL); - loading_image = gtk_image_new_from_animation (loading_pixbuf); - g_object_unref (loading_pixbuf); - gtk_box_pack_start (GTK_BOX (label_hbox), loading_image, FALSE, FALSE, 0); + /* setup load feedback */ + spinner = ephy_spinner_new (); + ephy_spinner_set_size (EPHY_SPINNER (spinner), GTK_ICON_SIZE_MENU); + gtk_box_pack_start (GTK_BOX (label_hbox), spinner, FALSE, FALSE, 0); /* setup site icon, empty by default */ icon = gtk_image_new (); @@ -909,7 +906,7 @@ build_tab_label (EphyNotebook *nb, EphyTab *tab) g_object_set_data (G_OBJECT (hbox), "label", label); g_object_set_data (G_OBJECT (hbox), "label-ebox", label_ebox); - g_object_set_data (G_OBJECT (hbox), "loading-image", loading_image); + g_object_set_data (G_OBJECT (hbox), "spinner", spinner); g_object_set_data (G_OBJECT (hbox), "icon", icon); g_object_set_data (G_OBJECT (hbox), "close-button", close_button); g_object_set_data (G_OBJECT (hbox), "tooltips", nb->priv->title_tips); diff --git a/src/toolbar.c b/src/toolbar.c index 16981fb02..bcff8f91f 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -399,39 +399,24 @@ toolbar_set_window (Toolbar *t, EphyWindow *window) } static void -toolbar_style_changed_cb (GtkToolbar *toolbar, - GtkToolbarStyle style, - GtkWidget *spinner) +fixed_toolbar_reconfigured_cb (GtkToolItem *fixed_item, + EphySpinner *spinner) { - gboolean small; + GtkToolbarStyle style; + GtkIconSize size; - small = (style != GTK_TOOLBAR_BOTH); + style = gtk_tool_item_get_toolbar_style (fixed_item); - ephy_spinner_set_small_mode (EPHY_SPINNER (spinner), small); -} - -static void -parent_set_cb (GtkWidget *item, - GtkObject *old_parent, - GtkWidget *spinner) -{ - if (old_parent != NULL) + if (style == GTK_TOOLBAR_BOTH) { - g_return_if_fail (GTK_IS_TOOLBAR (old_parent)); - - g_signal_handlers_disconnect_by_func - (old_parent, G_CALLBACK (toolbar_style_changed_cb), - spinner); + size = GTK_ICON_SIZE_INVALID; } - - if (item->parent) + else { - g_return_if_fail (GTK_IS_TOOLBAR (item->parent)); - - g_signal_connect (item->parent, "style_changed", - G_CALLBACK (toolbar_style_changed_cb), - spinner); + size = GTK_ICON_SIZE_LARGE_TOOLBAR; } + + ephy_spinner_set_size (spinner, size); } static void @@ -452,10 +437,10 @@ toolbar_init (Toolbar *t) gtk_container_add (GTK_CONTAINER (item), spinner); gtk_widget_show (GTK_WIDGET (item)); - g_signal_connect (item, "parent_set", - G_CALLBACK (parent_set_cb), spinner); - egg_editable_toolbar_set_fixed (EGG_EDITABLE_TOOLBAR (t), item); + + g_signal_connect (item, "toolbar-reconfigured", + G_CALLBACK (fixed_toolbar_reconfigured_cb), spinner); } static void |