[PATCH] Fix tabular layout icon positions



The attached patch is meant to fix bug 153519 [1] by making the
algorithm used for determining the x icon position in the first column
match the algorithm used for subsequent columns (find_empty_position).
The bug report has some more details.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=153519

-- 
Christian Neumair <chris gnome-de org>
Index: libnautilus-private/nautilus-icon-container.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.406
diff -u -p -r1.406 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	12 Dec 2005 16:59:10 -0000	1.406
+++ libnautilus-private/nautilus-icon-container.c	23 Jan 2006 21:57:26 -0000
@@ -1460,8 +1454,8 @@ lay_down_icons_tblr (NautilusIconContain
 			if (icon_is_positioned (icon)) {
 				placed_icons = g_list_prepend (placed_icons, icon);
 			} else {
-				icon->x = 0;
-				icon->y = 0;
+				icon->x = ICON_UNPOSITIONED_VALUE;
+				icon->y = ICON_UNPOSITIONED_VALUE;
 				unplaced_icons = g_list_prepend (unplaced_icons, icon);
 			}
 		}
@@ -1481,11 +1475,9 @@ lay_down_icons_tblr (NautilusIconContain
 				icon = p->data;
 				
 				icon_rect = nautilus_icon_canvas_item_get_icon_rectangle (icon->item);
-				icon_get_bounding_box (icon, 
-						       &x1, &y1, &x2, &y2);
-				
+
 				/* Start the icon in the first column */ 
-				x = DESKTOP_PAD_HORIZONTAL + SNAP_SIZE_X - ((x2 - x1) / 2);
+				x = DESKTOP_PAD_HORIZONTAL + (SNAP_SIZE_X / 2);
 				y = DESKTOP_PAD_VERTICAL + SNAP_SIZE_Y - (icon_rect.y1 - icon_rect.y0);
 
 				find_empty_location (container,

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]