Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37530237
en ru br
ALT Linux repos
S:0.1.11-alt3.2.qa1
5.0: 0.1.11-alt2
4.1: 0.1.11-alt2
4.0: 0.1.10-alt1

Group :: System/Libraries
RPM: libsexy

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: libsexy-0.1.11-icon-name.patch
Download


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;
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin