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"
18 void pan_timeline_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height)
26 PanItem *pi_month = NULL;
27 PanItem *pi_day = NULL;
33 list = pan_list_tree(dir_fd, SORT_NONE, TRUE, pw->ignore_symlinks);
35 if (pw->cache_list && pw->exif_date_enable)
37 pw->cache_list = pan_cache_sort(pw->cache_list, SORT_NAME, TRUE);
38 list = filelist_sort(list, SORT_NAME, TRUE);
39 pan_cache_sync_date(pw, list);
42 pw->cache_list = pan_cache_sort(pw->cache_list, SORT_TIME, TRUE);
43 list = filelist_sort(list, SORT_TIME, TRUE);
45 *width = PAN_BOX_BORDER * 2;
46 *height = PAN_BOX_BORDER * 2;
51 day_start = month_start;
66 if (!pan_date_compare(fd->date, tc, PAN_DATE_LENGTH_DAY))
71 if (!pan_date_compare(fd->date, tc, PAN_DATE_LENGTH_MONTH))
77 x = pi_month->x + pi_month->width + PAN_BOX_BORDER;
86 buf = pan_date_value_string(fd->date, PAN_DATE_LENGTH_MONTH);
87 pi = pan_item_text_new(pw, x, y, buf,
88 PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING,
94 pi_month = pan_item_box_new(pw, file_data_ref(fd),
96 PAN_BOX_OUTLINE_THICKNESS,
97 PAN_BOX_COLOR, PAN_BOX_ALPHA,
98 PAN_BOX_OUTLINE_COLOR, PAN_BOX_OUTLINE_ALPHA);
105 if (pi_day) x = pi_day->x + pi_day->width + PAN_BOX_BORDER;
117 if (pan_date_compare(nfd->date, tc, PAN_DATE_LENGTH_DAY))
119 needle = needle->next;
128 buf = pan_date_value_string(fd->date, PAN_DATE_LENGTH_WEEK);
129 pi = pan_item_text_new(pw, x, y, buf, PAN_TEXT_ATTR_NONE,
130 PAN_TEXT_BORDER_SIZE,
131 PAN_TEXT_COLOR, 255);
136 pi_day = pan_item_box_new(pw, file_data_ref(fd), x, y, 0, 0,
137 PAN_BOX_OUTLINE_THICKNESS,
138 PAN_BOX_COLOR, PAN_BOX_ALPHA,
139 PAN_BOX_OUTLINE_COLOR, PAN_BOX_OUTLINE_ALPHA);
146 if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE)
148 pi = pan_item_image_new(pw, fd, x, y, 10, 10);
149 if (pi->width > x_width) x_width = pi->width;
150 y_height = pi->height;
154 pi = pan_item_thumb_new(pw, fd, x, y);
155 x_width = PAN_THUMB_SIZE;
156 y_height = PAN_THUMB_SIZE;
159 pan_item_size_by_item(pi_day, pi, PAN_BOX_BORDER);
160 pan_item_size_by_item(pi_month, pi_day, PAN_BOX_BORDER);
165 if (total > 0 && count < PAN_GROUP_MAX)
167 y += y_height + PAN_THUMB_GAP;
171 x += x_width + PAN_THUMB_GAP;
181 pan_item_size_coordinates(pi_month, PAN_BOX_BORDER, width, height);
186 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */