GNOME Bugzilla – Bug 80429
Shortening the `Open with...' buttons in the sidebar
Last modified: 2005-07-15 13:50:52 UTC
To make the `Open with <app>' buttons in the sidebar shorter (as they are often wider than the sidebar itself) one option would be to remove the `Open with ' preamble from the individual buttons and display it as a header instead. The following patch basically does this already (http://me.in-berlin.de/~lars/cruft/open-with.png) but at least one issue still needs to be addressed: the label doesn't change the color like the other text in the sidebar and thus becomes unreadable on a dark background. Index: src/nautilus-sidebar.c =================================================================== RCS file: /cvs/gnome/nautilus/src/nautilus-sidebar.c,v retrieving revision 1.210 diff -p -u -r1.210 nautilus-sidebar.c --- src/nautilus-sidebar.c 2002/04/05 15:34:45 1.210 +++ src/nautilus-sidebar.c 2002/05/01 02:49:25 @@ -1352,18 +1352,23 @@ add_command_buttons (NautilusSidebar *si { char *id_string, *temp_str, *file_path; GList *p; + GtkWidget *header_label; GtkWidget *temp_button; GnomeVFSMimeApplication *application; - /* There's always at least the "Open with..." button */ + /* There's always at least the "An Application..." button */ sidebar->details->has_buttons = TRUE; + header_label = gtk_label_new (_("Open with:")); + gtk_widget_show(header_label); + gtk_misc_set_alignment(GTK_MISC (header_label), 0.5, 0.5); + gtk_box_pack_start (GTK_BOX (sidebar->details->button_box), + header_label, FALSE, FALSE, 0); + 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); - g_free (temp_str); + temp_button = gtk_button_new_with_label (application->name); gtk_box_pack_start (GTK_BOX (sidebar->details->button_box), temp_button, FALSE, FALSE, @@ -1390,7 +1395,9 @@ add_command_buttons (NautilusSidebar *si } /* Catch-all button after all the others. */ - temp_button = gtk_button_new_with_label (_("Open with...")); + temp_button = gtk_button_new_with_label (application_list == NULL + ? _("An Application...") + : _("Other Application...")); g_signal_connect (temp_button, "clicked", G_CALLBACK (open_with_callback), NULL); g_object_set_data (G_OBJECT (temp_button), "user_data", sidebar);
you really need to email the nautilus-list@gnome.org about patches or they will never be applied.
Hmmm, I already did so a few days before filing the bug: <87g01gx69g.fsf@lars.in-berlin.de> <874rhwwx2r.fsf@lars.in-berlin.de> Except for Alex Larson (who said that it looked like a possible solution; see <Pine.LNX.4.44.0204271928060.8973-100000@devserv.devel.redhat.com>) nobody said something, so I filed this as a bug to make sure it isn't completely forgotten. And as I said: the patch still needs a few changes before it should actually be applied.
*** Bug 46882 has been marked as a duplicate of this bug. ***
Adding 'usability' because sometimes these flow way over making them hard to read.
Created attachment 49181 [details] [review] patch using ellipsis The original patch is somewhat outdated (more than 3 years old), so here is a new one that makes things, if not ideal, at least a little better.
This last patch has been committed.