update default gtk window icon source to use resources
This commit is contained in:
parent
8ef292b9ca
commit
61fdc8fd6f
12
gtk/gui.c
12
gtk/gui.c
|
@ -79,7 +79,8 @@ char *themelist_file_location;
|
|||
|
||||
char *nsgtk_config_home; /* exported global defined in gtk/gui.h */
|
||||
|
||||
GdkPixbuf *favicon_pixbuf; /* favicon default pixbuf */
|
||||
GdkPixbuf *favicon_pixbuf; /** favicon default pixbuf */
|
||||
GdkPixbuf *win_default_icon_pixbuf; /** default window icon pixbuf */
|
||||
|
||||
GtkBuilder *warning_builder;
|
||||
|
||||
|
@ -281,10 +282,11 @@ static nserror nsgtk_init(int argc, char** argv, char **respath)
|
|||
gtk_builder_connect_signals(warning_builder, NULL);
|
||||
|
||||
/* set default icon if its available */
|
||||
resource_filename = filepath_find(respath, "netsurf.xpm");
|
||||
if (resource_filename != NULL) {
|
||||
gtk_window_set_default_icon_from_file(resource_filename, NULL);
|
||||
free(resource_filename);
|
||||
error = nsgdk_pixbuf_new_from_resname("netsurf.xpm",
|
||||
&win_default_icon_pixbuf);
|
||||
if (error == NSERROR_OK) {
|
||||
LOG("Seting default window icon");
|
||||
gtk_window_set_default_icon(win_default_icon_pixbuf);
|
||||
}
|
||||
|
||||
/* Search engine sources */
|
||||
|
|
|
@ -28,5 +28,6 @@
|
|||
<file>tabcontents.gtk3.ui</file>
|
||||
<file>warning.gtk2.ui</file>
|
||||
<file>favicon.png</file>
|
||||
<file>netsurf.xpm</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
|
|
@ -73,6 +73,7 @@ static struct nsgtk_resource_s ui_resource[] = {
|
|||
|
||||
static struct nsgtk_resource_s gen_resource[] = {
|
||||
{ "favicon.png", 11, NSGTK_RESOURCE_FILE, NULL },
|
||||
{ "netsurf.xpm", 11, NSGTK_RESOURCE_FILE, NULL },
|
||||
{ NULL, 0, NSGTK_RESOURCE_FILE, NULL },
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue