soc.2008.themes: d8168b44: fized the icon diplay bug with the icon ...

ffdragon at soc.pidgin.im ffdragon at soc.pidgin.im
Fri Aug 8 16:50:45 EDT 2008


-----------------------------------------------------------------
Revision: d8168b447d994f505cf343765502175dccd1ffcc
Ancestor: b711c32b9f26f30a3ef05170fad0c6f946fe8ce3
Author: ffdragon at soc.pidgin.im
Date: 2008-08-08T16:45:21
Branch: im.pidgin.soc.2008.themes
URL: http://d.pidgin.im/viewmtn/revision/info/d8168b447d994f505cf343765502175dccd1ffcc

Modified files:
        pidgin/pidginstock.c

ChangeLog: 

fized the icon diplay bug with the icon theme 

-------------- next part --------------
============================================================
--- pidgin/pidginstock.c	6a0f5db11b0b11a22368f60e7a2e7b2c7ff45515
+++ pidgin/pidginstock.c	e1fb7a49af845cf8488b13b1f5493e10c10ad9f0
@@ -292,17 +292,16 @@ add_sized_icon(GtkIconSet *iconset, GtkI
 		const char *size, SizedStockIcon sized_icon, gboolean translucent)
 {
 	char *filename;
-	GtkIconSource *source;	
+	GtkIconSource *source;
 	GdkPixbuf *pixbuf;
 
 	filename = find_icon_file(theme, size, sized_icon, FALSE);
 	pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
+	if (translucent)
+		do_alphashift(pixbuf, pixbuf);
 
 	source = gtk_icon_source_new();
-	if (translucent) {
-		do_alphashift(pixbuf, pixbuf);
-       		gtk_icon_source_set_pixbuf(source, pixbuf);
-	} else gtk_icon_source_set_filename(source, filename);
+	gtk_icon_source_set_pixbuf(source, pixbuf);
 	gtk_icon_source_set_direction(source, GTK_TEXT_DIR_LTR);
         gtk_icon_source_set_direction_wildcarded(source, !sized_icon.rtl);
 	gtk_icon_source_set_size(source, sizeid);
@@ -313,9 +312,7 @@ add_sized_icon(GtkIconSet *iconset, GtkI
 
 	if (sizeid == gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)) {
 		source = gtk_icon_source_new();
-	        if (translucent) 
-       			gtk_icon_source_set_pixbuf(source, pixbuf);
-		else gtk_icon_source_set_filename(source, filename);
+	        gtk_icon_source_set_pixbuf(source, pixbuf);
         	gtk_icon_source_set_direction_wildcarded(source, TRUE);
 	        gtk_icon_source_set_size(source, GTK_ICON_SIZE_MENU);
 	        gtk_icon_source_set_size_wildcarded(source, FALSE);
@@ -328,12 +325,13 @@ add_sized_icon(GtkIconSet *iconset, GtkI
 
        if (sized_icon.rtl) {
 		filename = find_icon_file(theme, size, sized_icon, TRUE);
- 		pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
-		source = gtk_icon_source_new();
-                if (translucent) {
+		pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
+		if (translucent)
 			do_alphashift(pixbuf, pixbuf);
-       			gtk_icon_source_set_pixbuf(source, pixbuf);
-		} else gtk_icon_source_set_filename(source, filename);
+
+		source = gtk_icon_source_new();
+        	gtk_icon_source_set_pixbuf(source, pixbuf);
+                gtk_icon_source_set_filename(source, filename);
                 gtk_icon_source_set_direction(source, GTK_TEXT_DIR_RTL);
                 gtk_icon_source_set_size(source, sizeid);
                 gtk_icon_source_set_size_wildcarded(source, FALSE);
@@ -374,9 +372,9 @@ pidgin_stock_load_status_icon_theme(Pidg
 			translucent = gtk_icon_set_new();
 
 #define ADD_SIZED_ICON(name, size) if (sized_status_icons[i].name) { \
-					add_sized_icon(normal, name, theme, size, sized_status_icons[i], FALSE);  \
+					add_sized_icon(normal, name, theme, size, sized_status_icons[i], FALSE); \
 					if (sized_status_icons[i].translucent_name) \
-						add_sized_icon(normal, name, theme, size, sized_status_icons[i], TRUE);  \
+						add_sized_icon(translucent, name, theme, size, sized_status_icons[i], TRUE); \
 				   }
 		ADD_SIZED_ICON(microscopic, "11");
 		ADD_SIZED_ICON(extra_small, "16");
@@ -390,12 +388,12 @@ pidgin_stock_load_status_icon_theme(Pidg
 		gtk_icon_set_unref(normal);
 
 		if (sized_status_icons[i].translucent_name) {
-
 			gtk_icon_factory_add(icon_factory, sized_status_icons[i].translucent_name, translucent);
 			gtk_icon_set_unref(translucent);
 		}
 	}
 
+
 	gtk_widget_destroy(win);
 	g_object_unref(G_OBJECT(icon_factory));
 }


More information about the Commits mailing list