GNOME Bugzilla – Bug 345025
should truncate long names in the lower-left button
Last modified: 2006-11-24 08:25:36 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/nautilus/+bug/49116 "While spatial-mode browsing long named folders, there's this button on the lower-left side of the window which is used to navigate to higher folders. When the folder has a long name this button gets long too, and causes the information on the right to get hidden. Since seeing the full folder name is not necessary (as it already appears on the title bar) but the text on the right can be important, I think the folder's name in the button should be truncated. Here's a mockup of what I mean: http://img145.imageshack.us/img145/3825/pantallazo5uj.png"
Thanks for forwarding the bug, Sebastien.
Created attachment 67707 [details] [review] Limits name lengths to MAX_SHORTNAME_PATH (currently 16) May want to tweak MAX_SHORTNAME_PATH - the current value makes the example folder name look like the mockup.
Well, since the patch exists already... could it be applied anytime soon?
From my mail: You can't just cut off a string like that. Its a utf8 string, and doing that might cause invalid utf8 (and crashes). It also means you cut of at MAX_SHORTNAME_LENGTH bytes, not chars. It might be far less characters, if the char are more than 1 bytes each. Also, i'm pretty sure that it does things even more wrong in complication scripts like arabic which is right-to-left. What you want to do is use the ellipsize functions in pango (like pango_layout_set_ellipsize) that do all the complicated work for you.
Created attachment 77067 [details] [review] Get GtkLabel to do all the hard work Thanks for the comments. I started looking at the Pango docs, and then worked out there's an easier way to do this... get the GtkLabel to do it for us. This patch sets the ellipsize property on the location label to PANGO_ELLIPSIZE_END, and then sets the maximum requested characters for the label to MAX_SHORTNAME_PATH.