! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[enh] Truncate filenames by inserting ellipsis in icon and compact view
Status:
RESOLVED: MOVED

Comments

Description Mahe 2015-08-09 15:30:50 CEST
Currently Thunar does not truncate filenames. This can lead to absurdly large item spacing in both icon and compact view as files with long filenames have their names displayed in full length, occupying a large amount of space.

Thunar should limit the length of filenames and truncate them by inserting ellipsis where necessary like most other file managers do.
Comment 1 Mahe 2015-08-09 15:34:30 CEST
Created attachment 6408 
Patch for adding filename truncation in icon and compact view.

This patch addresses the issue by adding filename truncation using ellipsis insertion. It introduces the following 3 new xfconf values and respective default values:

icon-view-text-lines: maximum amount of lines for filenames in icon view (default: 4)
compact-view-text-width: maximum pixel width for filenames in compact view (default: 300)
misc-truncate-filenames: boolean toggling the new truncate/ellipsize behavior for filenames (default: TRUE)

I propose the variables to be kept as hidden settings.

I chose to not put the ellipsis at the end of the filenames as many other file managers do it, but in the center. This will keep the file extension readable in most cases which I find quite handy.
However if you deem this unsuitable, feel free to replace the occurences of "PANGO_ELLIPSIZE_MIDDLE" with "PANGO_ELLIPSIZE_END" which will result in the ellipsis being appended at the end instead.
Comment 2 Julien [nodiscc] editbugs 2015-09-25 14:41:30 CEST
Created attachment 6462 
screenshot of problematic behavior
Comment 3 alexxcons editbugs 2018-03-03 23:24:47 CET
Provided patch only works for thunar/gtk2

For thunar/gtk3 (master) the complete thunar-text-renderer was removed, GtkCellRendererText is used instead.

For GtkCellRendererText it seems not to be possible to pass "wrap-mode" and "ellipsize" together in a meaningfull way.
According to https://wiki.gnome.org/HowDoI/Labels one needs to adjust gtk_label_set_lines as well. Not sure where this can be done. In exo ?
Comment 4 alexxcons editbugs 2018-05-05 22:11:57 CEST
Bug #13973 contains some further information regarding GtkCellRendererText in gtk3
Comment 5 Git Bot editbugs 2020-05-26 23:23:49 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/thunar/-/issues/117.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #12126

Reported by:
Mahe
Reported on: 2015-08-09
Last modified on: 2020-05-26

People

Assignee:
Xfce Bug Triage
CC List:
6 users

Version

Version:
1.6.10

Attachments

Additional information