[epiphany/wip/exalm/favicon: 3/3] Load missing favicon as a symbolic icon
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/exalm/favicon: 3/3] Load missing favicon as a symbolic icon
- Date: Thu, 9 May 2019 18:40:22 +0000 (UTC)
commit 7981e9eb51f43096c2e31a86616f10dd56ce870f
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Thu May 9 13:58:50 2019 +0500
Load missing favicon as a symbolic icon
Add missing-favicon-symbolic.svg to the internal icon theme and set
it by name where it's used. This allows it to be recolored as a
symbolic icon.
src/ephy-page-row.c | 9 +++++----
src/ephy-tab-label.c | 10 +++++-----
...-favicon-symbolic.svg => ephy-missing-favicon-symbolic.svg} | 0
src/resources/epiphany.gresource.xml | 2 +-
4 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/ephy-page-row.c b/src/ephy-page-row.c
index 0c021bf0e..24da63723 100644
--- a/src/ephy-page-row.c
+++ b/src/ephy-page-row.c
@@ -138,10 +138,11 @@ sync_favicon (EphyWebView *view,
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);
+ if (pixbuf)
+ gtk_image_set_from_pixbuf (self->icon, pixbuf);
+ else
+ gtk_image_set_from_icon_name (self->icon, "ephy-missing-favicon-symbolic",
+ GTK_ICON_SIZE_MENU);
}
EphyPageRow *
diff --git a/src/ephy-tab-label.c b/src/ephy-tab-label.c
index 913bff0a5..7a23557dd 100644
--- a/src/ephy-tab-label.c
+++ b/src/ephy-tab-label.c
@@ -76,12 +76,12 @@ static void
ephy_tab_label_update_icon (EphyTabLabel *self)
{
if (!self->has_icon) {
- g_autoptr(GdkPixbuf) pixbuf = NULL;
-
if (self->is_pinned)
- pixbuf = gdk_pixbuf_new_from_resource ("/org/gnome/epiphany/missing-favicon-symbolic.svg", NULL);
-
- gtk_image_set_from_pixbuf (GTK_IMAGE (self->icon), pixbuf);
+ gtk_image_set_from_icon_name (GTK_IMAGE (self->icon),
+ "ephy-missing-favicon-symbolic",
+ GTK_ICON_SIZE_MENU);
+ else
+ gtk_image_set_from_pixbuf (GTK_IMAGE (self->icon), NULL);
}
}
diff --git a/src/resources/missing-favicon-symbolic.svg b/src/resources/ephy-missing-favicon-symbolic.svg
similarity index 100%
rename from src/resources/missing-favicon-symbolic.svg
rename to src/resources/ephy-missing-favicon-symbolic.svg
diff --git a/src/resources/epiphany.gresource.xml b/src/resources/epiphany.gresource.xml
index 5da83cc74..d1da5f287 100644
--- a/src/resources/epiphany.gresource.xml
+++ b/src/resources/epiphany.gresource.xml
@@ -5,7 +5,6 @@
<file>computer-fail-symbolic.png</file>
<file preprocess="xml-stripblanks" compressed="true">private-mode.svg</file>
<file preprocess="xml-stripblanks" compressed="true">web-watermark.svg</file>
- <file preprocess="xml-stripblanks" compressed="true">missing-favicon-symbolic.svg</file>
<file>network-error-symbolic.png</file>
<file>security-high-symbolic.png</file>
<file compressed="true">about.ini</file>
@@ -54,6 +53,7 @@
<gresource prefix="/org/gnome/Epiphany/icons">
<file compressed="true"
alias="scalable/actions/ephy-bookmarks-symbolic.svg">ephy-bookmarks-symbolic.svg</file>
<file compressed="true"
alias="scalable/actions/ephy-bookmark-tag-symbolic.svg">ephy-bookmark-tag-symbolic.svg</file>
+ <file compressed="true"
alias="scalable/actions/ephy-missing-favicon-symbolic.svg">ephy-missing-favicon-symbolic.svg</file>
<file compressed="true"
alias="scalable/actions/ephy-reader-mode-symbolic.svg">ephy-reader-mode-symbolic.svg</file>
</gresource>
<gresource prefix="/org/gnome/Epiphany">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]