From 541acda906e6d725468aa31bcc95f43d1cca23d4 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 15 Sep 2019 22:52:36 +0100 Subject: [PATCH] add cookie icon and use it for show cookies toolbar button --- frontends/gtk/gui.c | 9 ++++++++- frontends/gtk/res/netsurf.gresource.xml | 1 + frontends/gtk/resources.c | 1 + frontends/gtk/toolbar_items.h | 2 +- resources/icons/show-cookie.png | Bin 0 -> 303 bytes 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 resources/icons/show-cookie.png diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c index 9b42ef96b..205c5481b 100644 --- a/frontends/gtk/gui.c +++ b/frontends/gtk/gui.c @@ -270,7 +270,14 @@ static nserror nsgtk_add_named_icons_to_theme(void) pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, false, 8, 8, 32); } gtk_icon_theme_add_builtin_icon("local-history", 32, pixbuf); - #endif + + res = nsgdk_pixbuf_new_from_resname("icons/show-cookie.png", &pixbuf); + if (res != NSERROR_OK) { + pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, false, 8, 24, 24); + } + gtk_icon_theme_add_builtin_icon("show-cookie", 24, pixbuf); + +#endif return NSERROR_OK; } diff --git a/frontends/gtk/res/netsurf.gresource.xml b/frontends/gtk/res/netsurf.gresource.xml index b475dc5fb..d9aa92119 100644 --- a/frontends/gtk/res/netsurf.gresource.xml +++ b/frontends/gtk/res/netsurf.gresource.xml @@ -57,6 +57,7 @@ quirks.css netsurf.png default.ico + icons/show-cookie.png icons/local-history.png icons/arrow-l.png icons/content.png diff --git a/frontends/gtk/resources.c b/frontends/gtk/resources.c index 9fd71166e..f48ddb410 100644 --- a/frontends/gtk/resources.c +++ b/frontends/gtk/resources.c @@ -96,6 +96,7 @@ static struct nsgtk_resource_s pixbuf_resource[] = { RES_ENTRY("netsurf.xpm"), RES_ENTRY("menu_cursor.png"), RES_ENTRY("icons/local-history.png"), + RES_ENTRY("icons/show-cookie.png"), RES_ENTRY("throbber/throbber0.png"), RES_ENTRY("throbber/throbber1.png"), RES_ENTRY("throbber/throbber2.png"), diff --git a/frontends/gtk/toolbar_items.h b/frontends/gtk/toolbar_items.h index 7a35112d6..344c09771 100644 --- a/frontends/gtk/toolbar_items.h +++ b/frontends/gtk/toolbar_items.h @@ -139,7 +139,7 @@ TOOLBAR_ITEM(LOCALHISTORY_BUTTON, localhistory, true, y, p, , NULL) TOOLBAR_ITEM(GLOBALHISTORY_BUTTON, globalhistory, true, y, p, gtkGlobalHistory, NULL) TOOLBAR_ITEM(ADDBOOKMARKS_BUTTON, addbookmarks, true, y, p, gtkAddBookMarks, NULL) TOOLBAR_ITEM(SHOWBOOKMARKS_BUTTON, showbookmarks, true, b, p, gtkShowBookMarks, "user-bookmarks") -TOOLBAR_ITEM(SHOWCOOKIES_BUTTON, showcookies, true, y, p, gtkShowCookies, NULL) +TOOLBAR_ITEM(SHOWCOOKIES_BUTTON, showcookies, true, b, p, gtkShowCookies, "show-cookie") TOOLBAR_ITEM(OPENLOCATION_BUTTON, openlocation, true, y, p, gtkOpenLocation, NULL) TOOLBAR_ITEM(NEXTTAB_BUTTON, nexttab, false, n, y, gtkNextTab, "media-skip-forward") TOOLBAR_ITEM(PREVTAB_BUTTON, prevtab, false, n, y, gtkPrevTab, "media-skip-backward") diff --git a/resources/icons/show-cookie.png b/resources/icons/show-cookie.png new file mode 100644 index 0000000000000000000000000000000000000000..8e449721c12bf5dea7b72ccad7c6b586f35e9e84 GIT binary patch literal 303 zcmV+~0nq-5P)%qilGNS^gtIh5k>}OWLcLZ&){dq+Lcx-IrHS7O}H}qVc#3p z#R7c0o-3^N{`BIi`x?QNNnn; z3RK5vUhk;_Z2CWfU#6vyqs=ZApcE7Yz@f=_c(dVqM5;o7KolfGKuFZ}ktSdR*!UtP zk+)Gn1=B@VlRa>h54UNzRXqYUK#Bk>loli>fP}iLpf0oa6@PHTBpLyqjfOy)T4yKi zQ%+2=