summaryrefslogtreecommitdiff
path: root/libnautilus-private
diff options
context:
space:
mode:
authorJohn Sullivan <sullivan@src.gnome.org>2001-03-01 22:21:43 +0000
committerJohn Sullivan <sullivan@src.gnome.org>2001-03-01 22:21:43 +0000
commitd54e684fd0161cf2674f52099492507d9dae170f (patch)
tree6fdb1d86e124c0ac6b6243b60a27721ddd4a2af3 /libnautilus-private
parentee18d0bb6bf7efc15fd8f533676198435adf0c34 (diff)
downloadnautilus-d54e684fd0161cf2674f52099492507d9dae170f.tar.gz
reviewed by: Darin Adler <darin@eazel.com>
Fixed bug 7164 (infinite redrawing in particular layout case) * libnautilus-extensions/nautilus-icon-container.c: (lay_down_icons_horizontal): Fixed the math for determining whether the current icon fits on the current row; added a FIXME about a questionable design choice. (size_allocate): Added a FIXME.
Diffstat (limited to 'libnautilus-private')
-rw-r--r--libnautilus-private/nautilus-icon-container.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index 45f3d159a..0f69b7f5b 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -835,7 +835,7 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
GList *p, *line_start;
NautilusIcon *icon;
ArtDRect bounds;
- double canvas_width, line_width, space_width, border_space_width, y;
+ double canvas_width, line_width, space_width, y;
/* Lay out icons a line at a time. */
canvas_width = GTK_WIDGET (container)->allocation.width / GNOME_CANVAS (container)->pixels_per_unit;
@@ -850,12 +850,13 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
(GNOME_CANVAS_ITEM (icon->item), &bounds);
space_width = get_icon_space_width (container, &bounds);
- /* we don't need the right-hand border space for the rightmost icon, so reduce
- the space width to compare with */
- border_space_width = space_width * .75;
+ /* If this icon doesn't fit, it's time to lay out the line that's queued up. */
- /* If this icon doesn't fit, lay out the line that's queued up. */
- if (line_start != p && line_width + border_space_width > canvas_width) {
+ /* FIXME: why don't we want to guarantee a small white space to the right of
+ * the last column just like we guarantee a small white space to the left of
+ * the first column?
+ */
+ if (line_start != p && line_width + space_width - ICON_PAD_RIGHT > canvas_width) {
lay_down_one_line (container, line_start, p, &y);
line_width = 0;
line_start = p;
@@ -2343,6 +2344,14 @@ size_allocate (GtkWidget *widget,
container = NAUTILUS_ICON_CONTAINER (widget);
need_layout_redone = !container->details->has_been_allocated;
+
+ /* FIXME bugzilla.eazel.com 7219:
+ * We shouldn't have to redo the layout when x, y, or height
+ * changes, only when width changes. However, just removing these
+ * tests causes a problem when you're vertically stretching a window
+ * taller than the size needed to display all contents (the whole
+ * batch of contents start moving down, centered in the extra space).
+ */
if (allocation->x != widget->allocation.x
|| allocation->width != widget->allocation.width
|| allocation->y != widget->allocation.y