Patches for Nautilus emblem window

"Milosz Derezynski" <[email protected]>
Newsgroups gmane.comp.gnome.devel
Message-ID <[email protected]>
Hello Everyone,

I've made 2 patches, one against nautilus' fm-properties-window.c and
another against eel's eel-labeled-image.c to give better layouting for the
properties window's emblems tab.

The patches are very simple and short.
The one thing i am not entirey sure about is if we want default centering
for the EelLabeledImage.

If no one disagrees, I'd commit these.

Cheers,
M.

-- 
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]

_______________________________________________
gnome-devel-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-devel-list
fm-properties-window.c.diff (text/x-diff, 1.5 KB)
Index: fm-properties-window.c
===================================================================
--- fm-properties-window.c	(revision 14648)
+++ fm-properties-window.c	(working copy)
@@ -116,6 +116,7 @@
 
 	GList *emblem_buttons;
 	GHashTable *initial_emblems;
+    GtkSizeGroup *emblems_size_group;
 
 	NautilusFile *group_change_file;
 	char         *group_change_group;
@@ -3434,6 +3435,11 @@
 	return FALSE;
 }
 
+static gint
+compare_icons_func(gconstpointer a, gconstpointer b)
+{
+    return g_strcmp0((char*)a,(char*)b);
+}
 
 static void
 create_emblems_page (FMPropertiesWindow *window)
@@ -3459,6 +3465,10 @@
 
 	window->details->initial_emblems = get_initial_emblems (window->details->original_files);
 
+    window->details->emblems_size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
+
+    g_list_sort(icons, (GCompareFunc)(compare_icons_func));
+
 	l = icons;
 	while (l != NULL) {
 		emblem_name = l->data;
@@ -3502,6 +3512,7 @@
 					 G_OBJECT (window),
 					 0);
 
+        gtk_size_group_add_widget(window->details->emblems_size_group, gtk_bin_get_child(GTK_BIN(button)));
 		gtk_container_add (GTK_CONTAINER (emblems_table), button);
 	}
 	eel_g_list_free_deep (icons);
@@ -5497,6 +5508,9 @@
 	g_list_free (window->details->emblem_buttons);
 	window->details->emblem_buttons = NULL;
 
+    g_object_unref(window->Details->emblems_size_group);
+	window->details->emblems_size_group = NULL;
+
 	if (window->details->initial_emblems) {
 		g_hash_table_destroy (window->details->initial_emblems);
 		window->details->initial_emblems = NULL;
eel-labeled-image.c.diff (text/x-diff, 473 B)
Index: eel-labeled-image.c
===================================================================
--- eel-labeled-image.c	(revision 2176)
+++ eel-labeled-image.c	(working copy)
@@ -1202,6 +1202,7 @@
 	}
 
  	labeled_image->details->image = gtk_image_new ();
+    gtk_misc_set_alignment(GTK_MISC(labeled_image->details->image), 0.5, 0.5);
 	gtk_container_add (GTK_CONTAINER (labeled_image), labeled_image->details->image);
 	gtk_widget_show (labeled_image->details->image);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.