7 * This software is released under the GNU General Public License (GNU GPL).
8 * Please read the included file COPYING for more information.
9 * This software comes with no warranty of any kind, use at your own risk!
14 #include "pan-types.h"
19 void pan_grid_compute(PanWindow *pw, const gchar *path, gint *width, gint *height)
27 list = pan_list_tree(path, SORT_NAME, TRUE, pw->ignore_symlinks);
29 grid_size = (gint)sqrt((double)g_list_length(list));
30 if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE)
32 grid_size = grid_size * (512 + PAN_THUMB_GAP) * pw->image_size / 100;
36 grid_size = grid_size * (PAN_THUMB_SIZE + PAN_THUMB_GAP);
41 *width = PAN_BOX_BORDER * 2;
42 *height = PAN_BOX_BORDER * 2;
55 if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE)
57 pi = pan_item_image_new(pw, fd, x, y, 10, 10);
59 x += pi->width + PAN_THUMB_GAP;
60 if (y + pi->height + PAN_THUMB_GAP > next_y) next_y = y + pi->height + PAN_THUMB_GAP;
69 pi = pan_item_thumb_new(pw, fd, x, y);
71 x += PAN_THUMB_SIZE + PAN_THUMB_GAP;
75 y += PAN_THUMB_SIZE + PAN_THUMB_GAP;
78 pan_item_size_coordinates(pi, PAN_THUMB_GAP, width, height);