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 153519 - Grid fitted icons in the Desktop (first column) are too much to the left
Grid fitted icons in the Desktop (first column) are too much to the left
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Desktop
2.13.x
Other All
: High trivial
: 2.14.x
Assigned To: Christian Neumair
Nautilus Maintainers
: 153512 163855 163883 326891 330910 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-09-23 08:48 UTC by Joaquin Cuenca Abela
Modified: 2006-02-13 22:28 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Proposed patch (1.28 KB, patch)
2006-01-23 22:09 UTC, Christian Neumair
none Details | Review

Description Joaquin Cuenca Abela 2004-09-23 08:48:47 UTC
Please describe the problem:
When you have the keep aligned option in nautilus, in the first column the icons
are strictly glued to the left side of the screen.

That makes the text of the text unreadable, as the text width is bigger than the
width of the icon.

The second column is really the first usable column to place the icons, but its
too far away from the left border. 

Steps to reproduce:
1. Select keep aligned option
2. Place the icons in the first or the second column


Actual results:
Icons lie in unnatural positions

Expected results:
The icons in the first column should be a few pixels more to the right

Does this happen every time?
Yes

Other information:
Comment 1 Vincent Noel 2004-09-23 15:26:15 UTC
I see this too. It's a little annoying.
Comment 2 Ryan McDougall 2004-12-18 03:10:06 UTC
*** Bug 153512 has been marked as a duplicate of this bug. ***
Comment 3 Vincent Noel 2005-01-12 21:43:40 UTC
*** Bug 163855 has been marked as a duplicate of this bug. ***
Comment 4 Vincent Noel 2005-01-12 21:44:10 UTC
Bug 163855 has a screenshot showing the problem (attachment 35913 [details]).
Comment 5 Vincent Noel 2005-01-13 18:07:33 UTC
*** Bug 163883 has been marked as a duplicate of this bug. ***
Comment 6 Vincent Noel 2005-01-13 18:08:19 UTC
Bug 163883 also has a screenshot (attachment 35920 [details]). 
Comment 7 Dmitriy Kropivnitskiy 2005-03-30 16:49:04 UTC
In 2.10 this only happens to files with file names wider than the icon. If I
create a file ttt.txt it will get properly aligned a file qwertyuiopasdfgh.txt
will get flushed to the left.
Comment 8 Aaron Gyes 2005-11-20 06:25:47 UTC
This is really annoying. Any fix planned?
Comment 9 Christian Neumair 2005-11-20 09:46:11 UTC
http://mail.gnome.org/archives/nautilus-list/2005-September/msg00211.html fixed
the issue for me. Alex didn't like it, but still didn't comment on my reply.
I'll further investigate it.
Comment 10 Sebastien Bacher 2005-11-30 09:39:14 UTC
Ubuntu has a bug about this: http://bugzilla.ubuntu.com/show_bug.cgi?id=20147
Comment 11 Christian Neumair 2006-01-23 22:09:50 UTC
Created attachment 57966 [details] [review]
Proposed patch

The attached patch fixes the issue for me.

The first half of it is an unimportant cleanup, the second half is a slight modification. The problem was that Nautilus subtracted the icon's width from the column width instead of using half the snap size. As you can see in find_empty_location, the column width for tblr layout is assumed to be the snap size for subsequent columns.

The onliest exception is the first layout (placed > 0 is not true) where the max_width is calculated.
Comment 12 Christian Neumair 2006-01-23 22:29:02 UTC
*** Bug 326891 has been marked as a duplicate of this bug. ***
Comment 13 Alexander Larsson 2006-02-06 16:50:58 UTC
I don't think the patch is totally right.
I think the right position to use is SNAP_WITH/2 - icon_width/2, so that we center the pixbuf in the snapped column. I commited something like this. It seems to work for me.
Comment 14 Christian Neumair 2006-02-12 21:03:30 UTC
*** Bug 330910 has been marked as a duplicate of this bug. ***
Comment 15 Federico Mena Quintero 2006-02-13 22:28:10 UTC
Alex's patch from comment #13 indeed appears to work.  I don't trust this very much:

+ x = DESKTOP_PAD_HORIZONTAL + (SNAP_SIZE_X / 2) - ((icon_rect.x1 - icon_rect.x0) / 2);

What if this is a very wide icon, so that (icon_rect.x1 - icon_rect.x0) / 2 > the_padding_constants?

I tried very wide filenames, and the bug doesn't happen; maybe it is because the code that draws the icons indeed constrains the width of the labels to something reasonable.  But I don't know if this maximum label width is always constrained to match the constants above.

Anyway - should we have this patch in the 2.12 branch as well?