[epiphany] Show placeholder favicon in page row
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Show placeholder favicon in page row
- Date: Thu, 2 May 2019 15:13:24 +0000 (UTC)
commit 499d0b0c6da2fcfe90bb37965aa25ff0207ab7e3
Author: Jan-Michael Brummer <jan brummer tabos org>
Date: Thu May 2 13:38:49 2019 +0200
Show placeholder favicon in page row
Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/745
src/ephy-page-row.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/ephy-page-row.c b/src/ephy-page-row.c
index ca63e1697..0c021bf0e 100644
--- a/src/ephy-page-row.c
+++ b/src/ephy-page-row.c
@@ -23,6 +23,7 @@
#include "ephy-embed-utils.h"
#include "ephy-page-row.h"
+#include "ephy-web-view.h"
enum {
CLOSED,
@@ -127,6 +128,22 @@ ephy_page_row_init (EphyPageRow *self)
gtk_widget_init_template (GTK_WIDGET (self));
}
+static void
+sync_favicon (EphyWebView *view,
+ GParamSpec *pspec,
+ EphyPageRow *self)
+{
+ g_autoptr(GdkPixbuf) pixbuf = NULL;
+
+ if (ephy_web_view_get_icon (view))
+ pixbuf = gdk_pixbuf_copy (ephy_web_view_get_icon (view));
+
+ if (!pixbuf)
+ pixbuf = gdk_pixbuf_new_from_resource ("/org/gnome/epiphany/missing-favicon-symbolic.svg", NULL);
+
+ gtk_image_set_from_pixbuf (self->icon, pixbuf);
+}
+
EphyPageRow *
ephy_page_row_new (EphyNotebook *notebook,
gint position)
@@ -146,7 +163,8 @@ ephy_page_row_new (EphyNotebook *notebook,
view = ephy_embed_get_web_view (EPHY_EMBED (embed));
- g_object_bind_property (view, "icon", self->icon, "pixbuf", G_BINDING_SYNC_CREATE);
+ sync_favicon (view, NULL, self);
+ g_signal_connect_object (view, "notify::icon", G_CALLBACK (sync_favicon), self, 0);
g_object_bind_property (embed, "title", self->title, "label", G_BINDING_SYNC_CREATE);
g_object_bind_property (embed, "title", self->title, "tooltip-text", G_BINDING_SYNC_CREATE);
g_object_bind_property (view, "is-playing-audio", self->speaker_icon, "visible", G_BINDING_SYNC_CREATE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]