[epiphany] Show favicon placeholder icon only in mobile mode
- From: Jan-Michael Brummer <jbrummer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Show favicon placeholder icon only in mobile mode
- Date: Tue, 21 Jul 2020 14:43:28 +0000 (UTC)
commit 9ce0c934eaafeaf4b9408caa989a760531e28423
Author: Jan-Michael Brummer <jan brummer tabos org>
Date: Mon Jul 20 22:25:58 2020 +0200
Show favicon placeholder icon only in mobile mode
src/ephy-desktop-utils.c | 5 +++--
src/ephy-desktop-utils.h | 7 ++++++-
src/ephy-page-row.c | 2 +-
src/ephy-tab-label.c | 2 +-
4 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/ephy-desktop-utils.c b/src/ephy-desktop-utils.c
index 9a8839614..54f21a1dd 100644
--- a/src/ephy-desktop-utils.c
+++ b/src/ephy-desktop-utils.c
@@ -45,7 +45,8 @@ get_icon_size (void)
}
const char *
-ephy_get_fallback_favicon_name (const char *uri)
+ephy_get_fallback_favicon_name (const char *uri,
+ EphyFaviconType type)
{
if (uri) {
if (g_str_has_prefix (uri, "ephy-about:overview") || g_str_has_prefix (uri, "about:overview"))
@@ -54,5 +55,5 @@ ephy_get_fallback_favicon_name (const char *uri)
return "web-browser-symbolic";
}
- return "ephy-missing-favicon-symbolic";
+ return type == EPHY_FAVICON_TYPE_SHOW_MISSING_PLACEHOLDER ? "ephy-missing-favicon-symbolic" : NULL;
}
diff --git a/src/ephy-desktop-utils.h b/src/ephy-desktop-utils.h
index fb4532a2a..c6fb04cad 100644
--- a/src/ephy-desktop-utils.h
+++ b/src/ephy-desktop-utils.h
@@ -25,10 +25,15 @@
G_BEGIN_DECLS
+typedef enum {
+ EPHY_FAVICON_TYPE_SHOW_MISSING_PLACEHOLDER,
+ EPHY_FAVICON_TYPE_NO_MISSING_PLACEHOLDER
+} EphyFaviconType;
+
gboolean is_desktop_pantheon (void);
GtkIconSize get_icon_size (void);
-const char *ephy_get_fallback_favicon_name (const char *title);
+const char *ephy_get_fallback_favicon_name (const char *title, EphyFaviconType type);
G_END_DECLS
diff --git a/src/ephy-page-row.c b/src/ephy-page-row.c
index fb359bd8d..79680a3dd 100644
--- a/src/ephy-page-row.c
+++ b/src/ephy-page-row.c
@@ -144,7 +144,7 @@ sync_favicon (EphyWebView *view,
if (pixbuf) {
gtk_image_set_from_pixbuf (self->icon, pixbuf);
} else {
- const char *favicon_name = ephy_get_fallback_favicon_name (ephy_web_view_get_display_address (view));
+ const char *favicon_name = ephy_get_fallback_favicon_name (ephy_web_view_get_display_address (view),
EPHY_FAVICON_TYPE_SHOW_MISSING_PLACEHOLDER);
gtk_image_set_from_icon_name (GTK_IMAGE (self->icon), favicon_name, GTK_ICON_SIZE_MENU);
}
diff --git a/src/ephy-tab-label.c b/src/ephy-tab-label.c
index bb2ea16c2..2d4b0209e 100644
--- a/src/ephy-tab-label.c
+++ b/src/ephy-tab-label.c
@@ -82,7 +82,7 @@ static void
ephy_tab_label_update_icon (EphyTabLabel *self)
{
if (!self->has_icon) {
- const char *favicon_name = ephy_get_fallback_favicon_name (self->uri);
+ const char *favicon_name = ephy_get_fallback_favicon_name (self->uri,
EPHY_FAVICON_TYPE_NO_MISSING_PLACEHOLDER);
gtk_image_set_from_icon_name (GTK_IMAGE (self->icon), favicon_name, GTK_ICON_SIZE_MENU);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]