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"
17 void pan_timeline_compute(PanWindow *pw, const gchar *path, gint *width, gint *height)
25 PanItem *pi_month = NULL;
26 PanItem *pi_day = NULL;
32 list = pan_list_tree(path, SORT_NONE, TRUE, pw->ignore_symlinks);
34 if (pw->cache_list && pw->exif_date_enable)
36 pw->cache_list = pan_cache_sort(pw->cache_list, SORT_NAME, TRUE);
37 list = filelist_sort(list, SORT_NAME, TRUE);
38 pan_cache_sync_date(pw, list);
41 pw->cache_list = pan_cache_sort(pw->cache_list, SORT_TIME, TRUE);
42 list = filelist_sort(list, SORT_TIME, TRUE);
44 *width = PAN_BOX_BORDER * 2;
45 *height = PAN_BOX_BORDER * 2;
50 day_start = month_start;
65 if (!pan_date_compare(fd->date, tc, PAN_DATE_LENGTH_DAY))
70 if (!pan_date_compare(fd->date, tc, PAN_DATE_LENGTH_MONTH))
76 x = pi_month->x + pi_month->width + PAN_BOX_BORDER;
85 buf = pan_date_value_string(fd->date, PAN_DATE_LENGTH_MONTH);
86 pi = pan_item_text_new(pw, x, y, buf,
87 PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING,
93 pi_month = pan_item_box_new(pw, file_data_new_simple(fd->path),
95 PAN_BOX_OUTLINE_THICKNESS,
96 PAN_BOX_COLOR, PAN_BOX_ALPHA,
97 PAN_BOX_OUTLINE_COLOR, PAN_BOX_OUTLINE_ALPHA);
104 if (pi_day) x = pi_day->x + pi_day->width + PAN_BOX_BORDER;
116 if (pan_date_compare(nfd->date, tc, PAN_DATE_LENGTH_DAY))
118 needle = needle->next;
127 buf = pan_date_value_string(fd->date, PAN_DATE_LENGTH_WEEK);
128 pi = pan_item_text_new(pw, x, y, buf, PAN_TEXT_ATTR_NONE,
129 PAN_TEXT_BORDER_SIZE,
130 PAN_TEXT_COLOR, 255);
135 pi_day = pan_item_box_new(pw, file_data_new_simple(fd->path), x, y, 0, 0,
136 PAN_BOX_OUTLINE_THICKNESS,
137 PAN_BOX_COLOR, PAN_BOX_ALPHA,
138 PAN_BOX_OUTLINE_COLOR, PAN_BOX_OUTLINE_ALPHA);
145 if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE)
147 pi = pan_item_image_new(pw, fd, x, y, 10, 10);
148 if (pi->width > x_width) x_width = pi->width;
149 y_height = pi->height;
153 pi = pan_item_thumb_new(pw, fd, x, y);
154 x_width = PAN_THUMB_SIZE;
155 y_height = PAN_THUMB_SIZE;
158 pan_item_size_by_item(pi_day, pi, PAN_BOX_BORDER);
159 pan_item_size_by_item(pi_month, pi_day, PAN_BOX_BORDER);
164 if (total > 0 && count < PAN_GROUP_MAX)
166 y += y_height + PAN_THUMB_GAP;
170 x += x_width + PAN_THUMB_GAP;
180 pan_item_size_coordinates(pi_month, PAN_BOX_BORDER, width, height);