After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 345025 - should truncate long names in the lower-left button
should truncate long names in the lower-left button
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
2.14.x
Other Linux
: Normal trivial
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-15 16:01 UTC by Sebastien Bacher
Modified: 2006-11-24 08:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Limits name lengths to MAX_SHORTNAME_PATH (currently 16) (849 bytes, patch)
2006-06-20 12:39 UTC, palfrey
needs-work Details | Review
Get GtkLabel to do all the hard work (1.03 KB, patch)
2006-11-23 16:41 UTC, palfrey
none Details | Review

Description Sebastien Bacher 2006-06-15 16:01:17 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"
Comment 1 David Prieto 2006-06-15 16:45:47 UTC
Thanks for forwarding the bug, Sebastien.
Comment 2 palfrey 2006-06-20 12:39:44 UTC
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.
Comment 3 David Prieto 2006-08-02 12:12:02 UTC
Well, since the patch exists already... could it be applied anytime soon?
Comment 4 Alexander Larsson 2006-11-23 15:33:42 UTC
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.
Comment 5 palfrey 2006-11-23 16:41:16 UTC
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.