4 * Copyright (C) 2008 - 2012 The Geeqie Team
8 * This software is released under the GNU General Public License (GNU GPL).
9 * Please read the included file COPYING for more information.
10 * This software comes with no warranty of any kind, use at your own risk!
15 #include "pan-types.h"
20 void pan_grid_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height)
28 list = pan_list_tree(dir_fd, SORT_NAME, TRUE, pw->ignore_symlinks);
30 grid_size = (gint)sqrt((gdouble)g_list_length(list));
31 if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE)
33 grid_size = grid_size * (512 + PAN_THUMB_GAP) * pw->image_size / 100;
37 grid_size = grid_size * (PAN_THUMB_SIZE + PAN_THUMB_GAP);
42 *width = PAN_BOX_BORDER * 2;
43 *height = PAN_BOX_BORDER * 2;
56 if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE)
58 pi = pan_item_image_new(pw, fd, x, y, 10, 10);
60 x += pi->width + PAN_THUMB_GAP;
61 if (y + pi->height + PAN_THUMB_GAP > next_y) next_y = y + pi->height + PAN_THUMB_GAP;
70 pi = pan_item_thumb_new(pw, fd, x, y);
72 x += PAN_THUMB_SIZE + PAN_THUMB_GAP;
76 y += PAN_THUMB_SIZE + PAN_THUMB_GAP;
79 pan_item_size_coordinates(pi, PAN_THUMB_GAP, width, height);
84 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */