diff options
author | Christian Persch <chpe@stud.uni-saarland.de> | 2003-04-01 19:55:41 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-04-01 19:55:41 +0800 |
commit | 6c25765d7c82c5b529746a5f75322473e8484a65 (patch) | |
tree | a2e6cfcd168e05ac0eabeb8f6a50ace9acaf662a /lib | |
parent | fe94f37cfdbeab550953efbe89cafedbafbaff51 (diff) | |
download | gsoc2013-epiphany-6c25765d7c82c5b529746a5f75322473e8484a65.tar.gz gsoc2013-epiphany-6c25765d7c82c5b529746a5f75322473e8484a65.tar.zst gsoc2013-epiphany-6c25765d7c82c5b529746a5f75322473e8484a65.zip |
Show favicons on tabs
2003-04-01 Christian Persch <chpe@stud.uni-saarland.de>
* lib/widgets/ephy-notebook.c: (ephy_notebook_set_page_status),
(ephy_notebook_set_page_icon), (tab_build_label):
* lib/widgets/ephy-notebook.h:
* src/ephy-tab.c: (ephy_tab_init), (ephy_tab_set_favicon),
(ephy_tab_favicon_cache_changed_cb), (ephy_tab_favicon_cb),
(ephy_tab_location_cb):
* src/ephy-tab.h:
* src/ephy-window.c: (ephy_window_init):
Show favicons on tabs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/widgets/ephy-notebook.c | 35 | ||||
-rw-r--r-- | lib/widgets/ephy-notebook.h | 4 |
2 files changed, 37 insertions, 2 deletions
diff --git a/lib/widgets/ephy-notebook.c b/lib/widgets/ephy-notebook.c index 9a0a1278b..b2ee52b57 100644 --- a/lib/widgets/ephy-notebook.c +++ b/lib/widgets/ephy-notebook.c @@ -634,7 +634,7 @@ ephy_notebook_set_page_status (EphyNotebook *nb, GtkWidget *child, EphyNotebookPageLoadStatus status) { - GtkWidget *tab, *image; + GtkWidget *tab, *image, *icon; g_return_if_fail (nb != NULL); @@ -650,22 +650,48 @@ ephy_notebook_set_page_status (EphyNotebook *nb, image = g_object_get_data (G_OBJECT (tab), "loading-image"); g_return_if_fail (image != NULL); + + icon = g_object_get_data (G_OBJECT (tab), "icon"); + + g_return_if_fail (icon != NULL); switch (status) { case EPHY_NOTEBOOK_TAB_LOAD_LOADING: + gtk_widget_hide (icon); gtk_widget_show (image); break; case EPHY_NOTEBOOK_TAB_LOAD_COMPLETED: case EPHY_NOTEBOOK_TAB_LOAD_NORMAL: gtk_widget_hide (image); + gtk_widget_show (icon); break; } nb->priv->current_status = status; } +void +ephy_notebook_set_page_icon (EphyNotebook *nb, + GtkWidget *child, + GdkPixbuf *icon) +{ + GtkWidget *tab, *image; + + g_return_if_fail (nb != NULL); + + tab = gtk_notebook_get_tab_label (GTK_NOTEBOOK (nb), child); + + g_return_if_fail (tab != NULL); + + image = g_object_get_data (G_OBJECT (tab), "icon"); + + g_return_if_fail (image != NULL); + + gtk_image_set_from_pixbuf (GTK_IMAGE (image), icon); +} + static void ephy_tab_close_button_clicked_cb (GtkWidget *widget, GtkWidget *child) @@ -683,7 +709,7 @@ tab_build_label (EphyNotebook *nb, GtkWidget *child) int h, w; GClosure *closure; GtkWidget *window; - GtkWidget *loading_image; + GtkWidget *loading_image, *icon; GdkPixbufAnimation *loading_pixbuf; window = gtk_widget_get_toplevel (GTK_WIDGET (nb)); @@ -710,6 +736,10 @@ tab_build_label (EphyNotebook *nb, GtkWidget *child) g_object_unref (loading_pixbuf); gtk_box_pack_start (GTK_BOX (hbox), loading_image, FALSE, FALSE, 0); + /* setup site icon, empty by default */ + icon = gtk_image_new (); + gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0); + /* setup label */ label = gtk_label_new (_("Untitled")); gtk_misc_set_alignment (GTK_MISC (label), 0.00, 0.5); @@ -742,6 +772,7 @@ tab_build_label (EphyNotebook *nb, GtkWidget *child) g_object_set_data (G_OBJECT (hbox), "label", label); g_object_set_data (G_OBJECT (hbox), "loading-image", loading_image); + g_object_set_data (G_OBJECT (hbox), "icon", icon); return hbox; } diff --git a/lib/widgets/ephy-notebook.h b/lib/widgets/ephy-notebook.h index 755eea84d..e90aa56b9 100644 --- a/lib/widgets/ephy-notebook.h +++ b/lib/widgets/ephy-notebook.h @@ -94,6 +94,10 @@ void ephy_notebook_set_page_title (EphyNotebook *nb, GtkWidget *child, const char *title); +void ephy_notebook_set_page_icon (EphyNotebook *nb, + GtkWidget *child, + GdkPixbuf *icon); + G_END_DECLS; #endif /* EPHY_NOTEBOOK_H */ |