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 159621 - Icons are outside the nautilus window with "text beside icons"
Icons are outside the nautilus window with "text beside icons"
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Views: Icon View
2.11.x
Other All
: High normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 307439 310113 324087 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-11-27 07:24 UTC by Baptiste Mille-Mathias
Modified: 2005-12-25 15:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
screenshot of the problem (11.16 KB, image/png)
2004-11-27 07:25 UTC, Baptiste Mille-Mathias
  Details
Proposed patch (1.80 KB, patch)
2005-03-07 20:24 UTC, Michael Terry
none Details | Review
Proposed patch (2.35 KB, patch)
2005-08-23 14:35 UTC, Christian Neumair
none Details | Review

Description Baptiste Mille-Mathias 2004-11-27 07:24:23 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
Comment 1 Baptiste Mille-Mathias 2004-11-27 07:25:09 UTC
Created attachment 34178 [details]
screenshot of the problem
Comment 2 Baptiste Mille-Mathias 2004-11-27 07:58:15 UTC
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.
Comment 3 Kevin Duffus 2005-01-08 16:51:12 UTC
i've also seen this behaviour in local folders (haven't tested with network
folders). i'm currently using CVS HEAD (08 January 2005).
Comment 4 Michael Terry 2005-03-07 20:24:20 UTC
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).
Comment 5 Kevin Duffus 2005-04-27 21:12:58 UTC
please add PATCH keyword and update nautilus version (bug still occurs in 2.10.1)
Comment 6 Sebastien Bacher 2005-06-01 07:59:19 UTC
There is an ubuntu bug about this too: http://bugzilla.ubuntu.com/11381
Comment 7 Baptiste Mille-Mathias 2005-06-01 10:51:52 UTC
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?
Comment 8 Michael Terry 2005-06-01 14:37:52 UTC
List has been emailed.
Comment 9 Sebastien Bacher 2005-06-13 20:52:59 UTC
*** Bug 307439 has been marked as a duplicate of this bug. ***
Comment 10 Martin Wehner 2005-06-18 13:04:06 UTC
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.
Comment 11 Sebastien Bacher 2005-07-12 11:20:54 UTC
*** Bug 310113 has been marked as a duplicate of this bug. ***
Comment 12 Christian Neumair 2005-08-21 14:56:24 UTC
Michael: Are you still willing to brush the patch up?
Comment 13 Michael Terry 2005-08-21 20:19:37 UTC
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.
Comment 14 Christian Neumair 2005-08-23 14:35:56 UTC
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
Comment 15 Alexander Larsson 2005-08-26 15:18:01 UTC
Yes, that was what i meant. Commited.
Comment 16 Funda Wang 2005-08-28 08:51:52 UTC
Will this patch be backported to gnome-2-10 branch?
Comment 17 Sebastien Bacher 2005-12-25 15:48:34 UTC
*** Bug 324087 has been marked as a duplicate of this bug. ***