[PATCH] ellipsize 'Open with' buttons in information side pane

Hey all,
here is a patch for bug 80429 : "Shortening the `Open with...' buttons
in the sidebar"


With this patch, if the side pane is too narrow, the button labels
will get ellipsized
from the beginning, e.g. "Open with Rhythmbox Music Player" will
become "... with Rhythmbox Music Player".

Of course this is not ideal, but it is still better than what we have
now (in its present state the side pane will only show the middle part
of buttons if it's too narrow). In any case the ellipsizing cannot
hurt, and it looks more professionnal than just cropping the buttons.

Index: src/nautilus-information-panel.c
RCS file: /cvs/gnome/nautilus/src/nautilus-information-panel.c,v
retrieving revision 1.230
diff -u -r1.230 nautilus-information-panel.c
--- src/nautilus-information-panel.c	28 Jun 2005 12:54:45 -0000	1.230
+++ src/nautilus-information-panel.c	14 Jul 2005 17:14:09 -0000
@@ -252,7 +252,7 @@
 	gtk_widget_show (GTK_WIDGET (information_panel->details->button_box));
 	gtk_box_pack_start (GTK_BOX (information_panel->details->button_box_centerer),
 			    GTK_WIDGET (information_panel->details->button_box),
-			    TRUE, FALSE, 0);
+			    TRUE, TRUE, 0);
 	information_panel->details->has_buttons = FALSE;
@@ -886,17 +886,19 @@
 	char *id_string, *temp_str;
 	GList *p;
-	GtkWidget *temp_button;
+	GtkWidget *temp_button, *label;
 	GnomeVFSMimeApplication *application;
 	/* There's always at least the "Open with..." button */
 	information_panel->details->has_buttons = TRUE;
-	for (p = application_list; p != NULL; p = p->next) {
+	for (p = application_list; p != NULL; p = p->next) {		
 	        application = p->data;	        
 		temp_str = g_strdup_printf (_("Open with %s"), application->name);
 	        temp_button = gtk_button_new_with_label (temp_str);
+		label = GTK_BIN (temp_button)->child;
+		gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_START);
 		g_free (temp_str);
 		gtk_box_pack_start (GTK_BOX (information_panel->details->button_box), 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]