rpms/libsexy/F-12 libsexy-icon-name.patch, NONE, 1.1 libsexy.spec, 1.24, 1.25

Brian Pepple bpepple at fedoraproject.org
Sun Nov 15 23:40:39 UTC 2009


Author: bpepple

Update of /cvs/pkgs/rpms/libsexy/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23341

Modified Files:
	libsexy.spec 
Added Files:
	libsexy-icon-name.patch 
Log Message:
* Sun Nov 15 2009 Brian Pepple <bpepple at fedoraproject.org> - 0.1.11-13
- Backport patch that allows SexyIconEntry to support images using icon-name.
- Drop requires on hunspell-en dictionary. (#517804)


libsexy-icon-name.patch:
 libsexy/sexy-icon-entry.c |   14 +++++++++++---
 tests/test-icon-entry.c   |   23 ++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 4 deletions(-)

--- NEW FILE libsexy-icon-name.patch ---
diff -urp libsexy-0.1.11.orig/libsexy/sexy-icon-entry.c libsexy-0.1.11/libsexy/sexy-icon-entry.c
--- libsexy-0.1.11.orig/libsexy/sexy-icon-entry.c	2007-03-17 23:30:00.000000000 -0400
+++ libsexy-0.1.11/libsexy/sexy-icon-entry.c	2009-11-15 18:21:08.560177737 -0500
@@ -468,9 +468,10 @@ static GdkPixbuf *
 get_pixbuf_from_icon(SexyIconEntry *entry, SexyIconEntryPosition icon_pos)
 {
 	GdkPixbuf *pixbuf = NULL;
-	gchar *stock_id;
+	const gchar *stock_id;
 	SexyIconInfo *icon_info = &entry->priv->icons[icon_pos];
 	GtkIconSize size;
+	int w, h;
 
 	switch (gtk_image_get_storage_type(GTK_IMAGE(icon_info->icon)))
 	{
@@ -480,11 +481,17 @@ get_pixbuf_from_icon(SexyIconEntry *entr
 			break;
 
 		case GTK_IMAGE_STOCK:
-			gtk_image_get_stock(GTK_IMAGE(icon_info->icon), &stock_id, &size);
+			gtk_image_get_stock(GTK_IMAGE(icon_info->icon), (char**)&stock_id, &size);
 			pixbuf = gtk_widget_render_icon(GTK_WIDGET(entry),
 											stock_id, size, NULL);
 			break;
 
+		case GTK_IMAGE_ICON_NAME:
+			gtk_image_get_icon_name (GTK_IMAGE(icon_info->icon), &stock_id, &size);
+			gtk_icon_size_lookup (size, &w, &h);
+			pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), stock_id, size, 0, NULL);
+			break;
+          
 		default:
 			return NULL;
 	}
@@ -655,7 +662,8 @@ update_icon(GObject *obj, GParamSpec *pa
 
 		if (strcmp(name, "pixbuf")   && strcmp(name, "stock")  &&
 			strcmp(name, "image")    && strcmp(name, "pixmap") &&
-			strcmp(name, "icon_set") && strcmp(name, "pixbuf_animation"))
+			strcmp(name, "icon-set") && strcmp(name, "pixbuf-animation") &&
+			strcmp(name, "icon-name"))
 		{
 			return;
 		}
diff -urp libsexy-0.1.11.orig/tests/test-icon-entry.c libsexy-0.1.11/tests/test-icon-entry.c
--- libsexy-0.1.11.orig/tests/test-icon-entry.c	2006-09-02 17:26:55.000000000 -0400
+++ libsexy-0.1.11/tests/test-icon-entry.c	2009-11-15 18:21:08.560913305 -0500
@@ -21,7 +21,7 @@ main(int argc, char **argv)
 	g_signal_connect(G_OBJECT(window), "destroy",
 					 G_CALLBACK(gtk_main_quit), NULL);
 
-	table = gtk_table_new(2, 4, FALSE);
+	table = gtk_table_new(2, 5, FALSE);
 	gtk_widget_show(table);
 	gtk_container_add(GTK_CONTAINER(window), table);
 	gtk_table_set_row_spacings(GTK_TABLE(table), 6);
@@ -128,6 +128,27 @@ main(int argc, char **argv)
 	gtk_table_attach(GTK_TABLE(table), icon_entry, 1, 2, 4, 5,
 					 GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
 
+	/*
+	 * Goto URL
+	 */
+	label = gtk_label_new("URL:");
+	gtk_widget_show(label);
+	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6,
+					 GTK_FILL, GTK_FILL, 0, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+
+	icon_entry = sexy_icon_entry_new();
+	gtk_widget_show(icon_entry);
+	gtk_table_attach(GTK_TABLE(table), icon_entry, 1, 2, 5, 6,
+					 GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
+
+	icon = gtk_image_new_from_icon_name ("stock_internet", GTK_ICON_SIZE_MENU);
+	gtk_widget_show(icon);
+	sexy_icon_entry_set_icon(SEXY_ICON_ENTRY(icon_entry),
+							 SEXY_ICON_ENTRY_SECONDARY,
+							 GTK_IMAGE(icon));
+	sexy_icon_entry_set_icon_highlight(SEXY_ICON_ENTRY(icon_entry),
+									   SEXY_ICON_ENTRY_PRIMARY, TRUE);
 	gtk_main();
 
 	return 0;


Index: libsexy.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libsexy/F-12/libsexy.spec,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -r1.24 -r1.25
--- libsexy.spec	12 Aug 2009 17:21:59 -0000	1.24
+++ libsexy.spec	15 Nov 2009 23:40:39 -0000	1.25
@@ -1,6 +1,6 @@
 Name:           libsexy
 Version:        0.1.11
-Release:        12%{?dist}
+Release:        13%{?dist}
 Summary:        Funky fresh graphical widgets for GTK+ 2
 
 Group:          System Environment/Libraries
@@ -8,13 +8,13 @@ License:        LGPLv2+
 URL:            http://www.chipx86.com/wiki/Libsexy
 Source0:        http://releases.chipx86.com/%{name}/%{name}/%{name}-%{version}.tar.bz2
 Patch0:		%{name}-%{version}-url-label.patch
+Patch1:		%{name}-icon-name.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  gtk2-devel
 BuildRequires:	libxml2-devel
 BuildRequires:	iso-codes-devel
 Requires:	enchant
-Requires:	hunspell-en
 
 
 %description
@@ -38,6 +38,7 @@ developing applications that use %{name}
 %prep
 %setup -q
 %patch0 -p1 -b .url-label
+%patch1 -p1 -b .icon-name
 
 
 %build
@@ -81,6 +82,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Sun Nov 15 2009 Brian Pepple <bpepple at fedoraproject.org> - 0.1.11-13
+- Backport patch that allows SexyIconEntry to support images using icon-name.
+- Drop requires on hunspell-en dictionary. (#517804)
+
 * Tue Aug 11 2009 Ville Skyttä <ville.skytta at iki.fi> - 0.1.11-12
 - Use bzipped upstream tarball.
 




More information about the fedora-extras-commits mailing list