GNOME Bugzilla – Bug 159621
Icons are outside the nautilus window with "text beside icons"
Last modified: 2005-12-25 15:48:34 UTC
I just upgraded to nautilus 2.9.1, and with the options set to "text beside icons", the icons of files on the left side on my $HOME windows are a little shifted on the left. It happened only on local file system, but not on remote (via VFS mount), or in windows like "Network" or "Disks". I attach a screenshot
Created attachment 34178 [details] screenshot of the problem
I made some mistakes earlier about the problem. it appears too in some windows when I browse the local network where I am, or in remote locations, but only in some random folders. Please don't hesitate to contact me to help to solve this issue.
i've also seen this behaviour in local folders (haven't tested with network folders). i'm currently using CVS HEAD (08 January 2005).
Created attachment 38384 [details] [review] Proposed patch From what I can tell, the problem is caused by a miscalculation of the largest text width of all items in a folder (or rather, a lack of calculation). To reproduce this bug, you can populate a folder with only files that have really short names. The attached patch is my novice-to-nautilus-code attempt at a fix. I calculate the maximum text width of all the files in a folder and use that calculated value instead of assuming the largest possible value (which happens to work as long as there are long filenames).
please add PATCH keyword and update nautilus version (bug still occurs in 2.10.1)
There is an ubuntu bug about this too: http://bugzilla.ubuntu.com/11381
I set the bug to a HIGH severity because of the patch. Michael, could you send a mail on the nautilus list concerning this problem, ask for a review of the patch?
List has been emailed.
*** Bug 307439 has been marked as a duplicate of this bug. ***
Comment on attachment 38384 [details] [review] Proposed patch Alex review from nautilus-list: I don't think that approach is right. We're calculating the max size of the icon+text and use that as the grid size. Then we use the max text size to set things up so that the right size of the icon/left side of the text is aligned vertically. This can be really wrong. Think of the case of a two-item directory, one item with a very wide icon but small text, one with a small icon but wide text. Say the *total* size of both icon+text are the same. This would mean we picked that size for grid size. But, to get the alignment right we really have to pick a grid size of max_icon_width + max_text_width. When that is done we really should use max_icon_width - icon_width as x_offset.
*** Bug 310113 has been marked as a duplicate of this bug. ***
Michael: Are you still willing to brush the patch up?
Whoops! I overlooked Martin's update. However, after reading his comments and the code, I agree that my patch didn't nail it, but I'm not really sure I know how to fix up the patch. This part of the code is a little foreign to me. If someone more familiar wants to fix it up, that'd be great. Otherwise, I'll revisit it when I have more time.
Created attachment 51193 [details] [review] Proposed patch The MAX_TEXT_WIDTH_BESIDE bits were neccessary because sometimes the text width is -1, for instance when loading my Desktop directory, and the calculating with text widths < 0 will lead to heavily broken layouts. I've also submitted this patch to the nautilus mailing list [1] for review. [1] http://mail.gnome.org/archives/nautilus-list/2005-August/msg00207.html
Yes, that was what i meant. Commited.
Will this patch be backported to gnome-2-10 branch?
*** Bug 324087 has been marked as a duplicate of this bug. ***