window icon patch



this patch allows you to just have:

gnome_window_icon_set_default_from_file ("gnome-terminal.png");

is there a better way of getting pixmaps?

jacob
-- 
"It drains me, and it shakes me, and hurts like hell everytime I play
it, looking out at thousands of people cheering and smiling, oblivious
to the tragedy of it's meaning, like when you're going to have your
dog put down and it's wagging it's tail on the way there." - Thom Yorke
Index: gnome-window-icon.c
===================================================================
RCS file: /cvs/gnome/libgnomeui/libgnomeui/gnome-window-icon.c,v
retrieving revision 1.3
diff -u -r1.3 gnome-window-icon.c
--- gnome-window-icon.c	2001/09/14 19:33:18	1.3
+++ gnome-window-icon.c	2001/09/24 21:57:08
@@ -21,13 +21,36 @@
 static GList *
 list_from_char_array (const char **s)
 {
+	GnomeProgram *prog;
 	GList *list = NULL;
 	int i;
-	
+
+	prog = gnome_program_get ();
+
 	for (i = 0; s[i]; i++) {
 		GdkPixbuf *pb;
+		char *pixfile = NULL;
+
+		if (*s[i] != G_DIR_SEPARATOR && prog) {
+			char *tmpfile;
+
+			tmpfile = g_build_filename ("pixmaps", s[i], NULL);
+
+			pixfile = gnome_program_locate_file (prog,
+							     GNOME_FILE_DOMAIN_APP_DATADIR,
+							     tmpfile, TRUE, NULL);
+
+			if (!pixfile)
+				pixfile = gnome_program_locate_file (prog,
+								     GNOME_FILE_DOMAIN_DATADIR,
+								     tmpfile, TRUE, NULL);
+
+			g_free (tmpfile);
+		}
+
+		pb = gdk_pixbuf_new_from_file (pixfile ? pixfile : s[i], NULL);
+		g_free (pixfile);
 
-		pb = gdk_pixbuf_new_from_file (s[i], NULL);
 		if (pb)
 			list = g_list_prepend (list, pb);
 	}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]