SF.net SVN: geany-plugins: [52] trunk/geanysendmail/src/geanysendmail.c

frlan at users.sourceforge.net frlan at xxxxx
Sun May 25 19:43:20 UTC 2008


Revision: 52
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=52&view=rev
Author:   frlan
Date:     2008-05-25 12:43:10 -0700 (Sun, 25 May 2008)

Log Message:
-----------
GeanySendMail: Make usage of icon from theme.

Uses old icon as fallback when no icon is available (fairly untested).

Modified Paths:
--------------
    trunk/geanysendmail/src/geanysendmail.c

Modified: trunk/geanysendmail/src/geanysendmail.c
===================================================================
--- trunk/geanysendmail/src/geanysendmail.c	2008-05-25 19:42:32 UTC (rev 51)
+++ trunk/geanysendmail/src/geanysendmail.c	2008-05-25 19:43:10 UTC (rev 52)
@@ -153,15 +153,25 @@
 
 void show_icon()
 {
-	GdkPixbuf *pixbuf = NULL;
+	GdkPixbuf *mailbutton_pb = NULL;
 	GtkWidget *icon = NULL;
-		
+	GtkIconSize size = geany_data->toolbar_prefs->icon_size;
+
 	int number_of_icons = 0;
 	number_of_icons = gtk_toolbar_get_n_items(GTK_TOOLBAR(main_widgets->toolbar));
-			pixbuf = gdk_pixbuf_new_from_inline(-1, mail_pixbuf, FALSE, NULL);
-	icon = gtk_image_new_from_pixbuf(pixbuf);
-	g_object_unref(pixbuf);
 
+	mailbutton_pb = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), 
+					"mail-message-new", size, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
+	
+	/* Fallback if icon is not part of theme */
+	if (mailbutton_pb == NULL)
+	{
+		mailbutton_pb = gdk_pixbuf_new_from_inline(-1, mail_pixbuf, FALSE, NULL);
+	}
+	
+	icon = gtk_image_new_from_pixbuf(mailbutton_pb);
+	g_object_unref(mailbutton_pb);
+
 	separator = (GtkWidget*) gtk_separator_tool_item_new();
 	gtk_widget_show (separator);
 	gtk_toolbar_insert(GTK_TOOLBAR(main_widgets->toolbar), GTK_TOOL_ITEM(separator), number_of_icons - 2);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list