r4209: Updated Japanese translation (Hiroaki Tanaka).
[rox-filer.git] / ROX-Filer / src / display.c
blobeaca87c810ba724eb833212ea5ee9f205aaef51b
1 /*
2 * $Id$
4 * ROX-Filer, filer for the ROX desktop project
5 * Copyright (C) 2005, the ROX-Filer team.
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
10 * any later version.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 * Place, Suite 330, Boston, MA 02111-1307 USA
22 /* display.c - code for arranging and displaying file items */
24 #include "config.h"
26 #include <stdlib.h>
27 #include <stdio.h>
28 #include <math.h>
29 #include <string.h>
30 #include <errno.h>
31 #include <sys/param.h>
32 #include <unistd.h>
33 #include <time.h>
34 #include <ctype.h>
36 #include <gtk/gtk.h>
37 #include <gdk/gdkx.h>
38 #include <gdk/gdkkeysyms.h>
40 #include "global.h"
42 #include "main.h"
43 #include "filer.h"
44 #include "display.h"
45 #include "support.h"
46 #include "gui_support.h"
47 #include "pixmaps.h"
48 #include "menu.h"
49 #include "dnd.h"
50 #include "run.h"
51 #include "mount.h"
52 #include "type.h"
53 #include "options.h"
54 #include "action.h"
55 #include "minibuffer.h"
56 #include "dir.h"
57 #include "diritem.h"
58 #include "fscache.h"
59 #include "view_iface.h"
61 #define HUGE_WRAP (1.5 * o_large_width.int_value)
63 /* Options bits */
64 static Option o_display_caps_first;
65 static Option o_display_dirs_first;
66 Option o_display_size;
67 Option o_display_details;
68 Option o_display_sort_by;
69 static Option o_large_width;
70 Option o_small_width;
71 Option o_display_show_hidden;
72 Option o_display_show_thumbs;
73 Option o_display_show_headers;
74 Option o_display_show_full_type;
75 Option o_display_inherit_options;
76 static Option o_filer_change_size_num;
77 Option o_vertical_order_small, o_vertical_order_large;
79 /* Static prototypes */
80 static void display_details_set(FilerWindow *filer_window, DetailsType details);
81 static void display_style_set(FilerWindow *filer_window, DisplayStyle style);
82 static void options_changed(void);
83 static char *details(FilerWindow *filer_window, DirItem *item);
84 static void display_set_actual_size_real(FilerWindow *filer_window);
86 /****************************************************************
87 * EXTERNAL INTERFACE *
88 ****************************************************************/
90 void display_init()
92 option_add_int(&o_display_caps_first, "display_caps_first", FALSE);
93 option_add_int(&o_display_dirs_first, "display_dirs_first", FALSE);
94 option_add_int(&o_display_size, "display_icon_size", AUTO_SIZE_ICONS);
95 option_add_int(&o_display_details, "display_details", DETAILS_NONE);
96 option_add_int(&o_display_sort_by, "display_sort_by", SORT_NAME);
97 option_add_int(&o_large_width, "display_large_width", 155);
98 option_add_int(&o_small_width, "display_small_width", 250);
99 option_add_int(&o_display_show_hidden, "display_show_hidden", FALSE);
100 option_add_int(&o_display_show_thumbs, "display_show_thumbs", FALSE);
101 option_add_int(&o_display_show_headers, "display_show_headers", TRUE);
102 option_add_int(&o_display_show_full_type, "display_show_full_type", FALSE);
103 option_add_int(&o_display_inherit_options,
104 "display_inherit_options", FALSE);
105 option_add_int(&o_filer_change_size_num, "filer_change_size_num", 30);
106 option_add_int(&o_vertical_order_small, "vertical_order_small", FALSE);
107 option_add_int(&o_vertical_order_large, "vertical_order_large", FALSE);
109 option_add_notify(options_changed);
112 static void draw_emblem_on_icon(GdkWindow *window, MaskedPixmap *image,
113 int *x, int y)
115 gdk_pixbuf_render_to_drawable_alpha(image->pixbuf,
116 window,
117 0, 0, /* src */
118 *x, y, /* dest */
119 -1, -1,
120 GDK_PIXBUF_ALPHA_FULL, 128, /* (unused) */
121 GDK_RGB_DITHER_NORMAL, 0, 0);
123 *x+=image->width+1;
126 /* Draw this icon (including any symlink or mount symbol) inside the
127 * given rectangle.
129 void draw_huge_icon(GdkWindow *window, GdkRectangle *area,
130 DirItem *item, MaskedPixmap *image, gboolean selected)
132 int width, height;
133 int image_x;
134 int image_y;
136 if (!image)
137 return;
139 width = image->huge_width;
140 height = image->huge_height;
141 image_x = area->x + ((area->width - width) >> 1);
142 image_y = MAX(0, area->height - height - 6);
144 gdk_pixbuf_render_to_drawable_alpha(
145 selected ? image->huge_pixbuf_lit
146 : image->huge_pixbuf,
147 window,
148 0, 0, /* src */
149 image_x, area->y + image_y, /* dest */
150 width, height,
151 GDK_PIXBUF_ALPHA_FULL, 128, /* (unused) */
152 GDK_RGB_DITHER_NORMAL, 0, 0);
154 if (item->flags & ITEM_FLAG_MOUNT_POINT)
156 MaskedPixmap *mp = item->flags & ITEM_FLAG_MOUNTED
157 ? im_mounted
158 : im_unmounted;
159 draw_emblem_on_icon(window, mp, &image_x, area->y + 2);
161 if (item->flags & ITEM_FLAG_SYMLINK)
163 draw_emblem_on_icon(window, im_symlink, &image_x, area->y + 2);
165 if (item->flags & ITEM_FLAG_HAS_XATTR)
167 draw_emblem_on_icon(window, im_xattr, &image_x, area->y + 2);
171 /* Draw this icon (including any symlink or mount symbol) inside the
172 * given rectangle.
174 void draw_large_icon(GdkWindow *window,
175 GdkRectangle *area,
176 DirItem *item,
177 MaskedPixmap *image,
178 gboolean selected)
180 int width;
181 int height;
182 int image_x;
183 int image_y;
185 if (!image)
186 return;
188 width = MIN(image->width, ICON_WIDTH);
189 height = MIN(image->height, ICON_HEIGHT);
190 image_x = area->x + ((area->width - width) >> 1);
191 image_y = MAX(0, area->height - height - 6);
193 gdk_pixbuf_render_to_drawable_alpha(
194 selected ? image->pixbuf_lit : image->pixbuf,
195 window,
196 0, 0, /* src */
197 image_x, area->y + image_y, /* dest */
198 width, height,
199 GDK_PIXBUF_ALPHA_FULL, 128, /* (unused) */
200 GDK_RGB_DITHER_NORMAL, 0, 0);
202 if (item->flags & ITEM_FLAG_MOUNT_POINT)
204 MaskedPixmap *mp = item->flags & ITEM_FLAG_MOUNTED
205 ? im_mounted
206 : im_unmounted;
207 draw_emblem_on_icon(window, mp, &image_x, area->y + 2);
209 if (item->flags & ITEM_FLAG_SYMLINK)
211 draw_emblem_on_icon(window, im_symlink, &image_x, area->y + 2);
213 if (item->flags & ITEM_FLAG_HAS_XATTR)
215 draw_emblem_on_icon(window, im_xattr, &image_x, area->y + 2);
219 void draw_small_icon(GdkWindow *window, GdkRectangle *area,
220 DirItem *item, MaskedPixmap *image, gboolean selected)
222 int width, height, image_x, image_y;
224 if (!image)
225 return;
227 if (!image->sm_pixbuf)
228 pixmap_make_small(image);
230 width = MIN(image->sm_width, SMALL_WIDTH);
231 height = MIN(image->sm_height, SMALL_HEIGHT);
232 image_x = area->x + ((area->width - width) >> 1);
233 image_y = MAX(0, SMALL_HEIGHT - image->sm_height);
235 gdk_pixbuf_render_to_drawable_alpha(
236 selected ? image->sm_pixbuf_lit : image->sm_pixbuf,
237 window,
238 0, 0, /* src */
239 image_x, area->y + image_y, /* dest */
240 width, height,
241 GDK_PIXBUF_ALPHA_FULL, 128, /* (unused) */
242 GDK_RGB_DITHER_NORMAL, 0, 0);
244 if (item->flags & ITEM_FLAG_MOUNT_POINT)
246 MaskedPixmap *mp = item->flags & ITEM_FLAG_MOUNTED
247 ? im_mounted
248 : im_unmounted;
249 draw_emblem_on_icon(window, mp, &image_x, area->y + 2);
251 if (item->flags & ITEM_FLAG_SYMLINK)
253 draw_emblem_on_icon(window, im_symlink, &image_x, area->y + 8);
255 if (item->flags & ITEM_FLAG_HAS_XATTR)
257 draw_emblem_on_icon(window, im_xattr, &image_x, area->y + 8);
261 /* The sort functions aren't called from outside, but they are
262 * passed as arguments to display_set_sort_fn().
265 #define IS_A_DIR(item) (item->base_type == TYPE_DIRECTORY && \
266 !(item->flags & ITEM_FLAG_APPDIR))
268 #define SORT_DIRS \
269 if (o_display_dirs_first.int_value) { \
270 gboolean id1 = IS_A_DIR(i1); \
271 gboolean id2 = IS_A_DIR(i2); \
272 if (id1 && !id2) return -1; \
273 if (id2 && !id1) return 1; \
276 int sort_by_name(const void *item1, const void *item2)
278 const DirItem *i1 = (DirItem *) item1;
279 const DirItem *i2 = (DirItem *) item2;
280 CollateKey *n1 = i1->leafname_collate;
281 CollateKey *n2 = i2->leafname_collate;
282 int retval;
284 SORT_DIRS;
286 retval = collate_key_cmp(n1, n2, o_display_caps_first.int_value);
288 return retval ? retval : strcmp(i1->leafname, i2->leafname);
291 int sort_by_type(const void *item1, const void *item2)
293 const DirItem *i1 = (DirItem *) item1;
294 const DirItem *i2 = (DirItem *) item2;
295 MIME_type *m1, *m2;
297 int diff = i1->base_type - i2->base_type;
299 if (!diff)
300 diff = (i1->flags & ITEM_FLAG_APPDIR)
301 - (i2->flags & ITEM_FLAG_APPDIR);
302 if (diff)
303 return diff > 0 ? 1 : -1;
305 m1 = i1->mime_type;
306 m2 = i2->mime_type;
308 if (m1 && m2)
310 diff = strcmp(m1->media_type, m2->media_type);
311 if (!diff)
312 diff = strcmp(m1->subtype, m2->subtype);
314 else if (m1 || m2)
315 diff = m1 ? 1 : -1;
316 else
317 diff = 0;
319 if (diff)
320 return diff > 0 ? 1 : -1;
322 return sort_by_name(item1, item2);
325 int sort_by_owner(const void *item1, const void *item2)
327 const DirItem *i1 = (DirItem *) item1;
328 const DirItem *i2 = (DirItem *) item2;
329 const gchar *name1;
330 const gchar *name2;
332 if(i1->uid==i2->uid)
333 return sort_by_name(item1, item2);
335 name1=user_name(i1->uid);
336 name2=user_name(i2->uid);
338 return strcmp(name1, name2);
341 int sort_by_group(const void *item1, const void *item2)
343 const DirItem *i1 = (DirItem *) item1;
344 const DirItem *i2 = (DirItem *) item2;
345 const gchar *name1;
346 const gchar *name2;
348 if(i1->gid==i2->gid)
349 return sort_by_name(item1, item2);
351 name1=group_name(i1->gid);
352 name2=group_name(i2->gid);
354 return strcmp(name1, name2);
357 int sort_by_date(const void *item1, const void *item2)
359 const DirItem *i1 = (DirItem *) item1;
360 const DirItem *i2 = (DirItem *) item2;
362 /* SORT_DIRS; -- too confusing! */
364 return i1->mtime < i2->mtime ? -1 :
365 i1->mtime > i2->mtime ? 1 :
366 sort_by_name(item1, item2);
369 int sort_by_size(const void *item1, const void *item2)
371 const DirItem *i1 = (DirItem *) item1;
372 const DirItem *i2 = (DirItem *) item2;
374 SORT_DIRS;
376 return i1->size < i2->size ? -1 :
377 i1->size > i2->size ? 1 :
378 sort_by_name(item1, item2);
381 void display_set_sort_type(FilerWindow *filer_window, SortType sort_type,
382 GtkSortType order)
384 if (filer_window->sort_type == sort_type &&
385 filer_window->sort_order == order)
386 return;
388 filer_window->sort_type = sort_type;
389 filer_window->sort_order = order;
391 view_sort(filer_window->view);
394 /* Change the icon size and style.
395 * force_resize should only be TRUE for new windows.
397 void display_set_layout(FilerWindow *filer_window,
398 DisplayStyle style,
399 DetailsType details,
400 gboolean force_resize)
402 gboolean style_changed = FALSE;
404 g_return_if_fail(filer_window != NULL);
406 if (filer_window->display_style_wanted != style
407 || filer_window->details_type != details)
409 style_changed = TRUE;
412 display_style_set(filer_window, style);
413 display_details_set(filer_window, details);
415 /* Recreate layouts because wrapping may have changed */
416 view_style_changed(filer_window->view, VIEW_UPDATE_NAME);
418 if (force_resize || o_filer_auto_resize.int_value == RESIZE_ALWAYS
419 || (o_filer_auto_resize.int_value == RESIZE_STYLE && style_changed))
421 view_autosize(filer_window->view);
425 /* Set the 'Show Thumbnails' flag for this window */
426 void display_set_thumbs(FilerWindow *filer_window, gboolean thumbs)
428 if (filer_window->show_thumbs == thumbs)
429 return;
431 filer_window->show_thumbs = thumbs;
433 view_style_changed(filer_window->view, VIEW_UPDATE_VIEWDATA);
435 if (!thumbs)
436 filer_cancel_thumbnails(filer_window);
438 filer_set_title(filer_window);
440 filer_create_thumbs(filer_window);
443 void display_update_hidden(FilerWindow *filer_window)
445 filer_detach_rescan(filer_window); /* (updates titlebar) */
447 display_set_actual_size(filer_window, FALSE);
450 /* Set the 'Show Hidden' flag for this window */
451 void display_set_hidden(FilerWindow *filer_window, gboolean hidden)
453 if (filer_window->show_hidden == hidden)
454 return;
457 filer_window->show_hidden = hidden;
459 filer_set_hidden(filer_window, hidden);
461 display_update_hidden(filer_window);
464 void display_set_filter(FilerWindow *filer_window, FilterType type,
465 const gchar *filter_string)
467 if (filer_set_filter(filer_window, type, filter_string))
468 display_update_hidden(filer_window);
472 /* Highlight (wink or cursor) this item in the filer window. If the item
473 * isn't already there but we're scanning then highlight it if it
474 * appears later.
476 void display_set_autoselect(FilerWindow *filer_window, const gchar *leaf)
478 gchar *new;
480 g_return_if_fail(filer_window != NULL);
481 g_return_if_fail(leaf != NULL);
483 new = g_strdup(leaf); /* leaf == old value sometimes */
485 null_g_free(&filer_window->auto_select);
487 if (view_autoselect(filer_window->view, new))
488 g_free(new);
489 else
490 filer_window->auto_select = new;
493 /* Change the icon size (wraps) */
494 void display_change_size(FilerWindow *filer_window, gboolean bigger)
496 DisplayStyle new;
498 g_return_if_fail(filer_window != NULL);
500 switch (filer_window->display_style)
502 case LARGE_ICONS:
503 new = bigger ? HUGE_ICONS : SMALL_ICONS;
504 break;
505 case HUGE_ICONS:
506 if (bigger)
507 return;
508 new = LARGE_ICONS;
509 break;
510 default:
511 if (!bigger)
512 return;
513 new = LARGE_ICONS;
514 break;
517 display_set_layout(filer_window, new, filer_window->details_type,
518 FALSE);
521 ViewData *display_create_viewdata(FilerWindow *filer_window, DirItem *item)
523 ViewData *view;
525 view = g_new(ViewData, 1);
527 view->layout = NULL;
528 view->details = NULL;
529 view->image = NULL;
531 display_update_view(filer_window, item, view, TRUE);
533 return view;
536 /* Set the display style to the desired style. If the desired style
537 * is AUTO_SIZE_ICONS, choose an appropriate size. Also resizes filer
538 * window, if requested.
540 void display_set_actual_size(FilerWindow *filer_window, gboolean force_resize)
542 display_set_layout(filer_window, filer_window->display_style_wanted,
543 filer_window->details_type, force_resize);
547 /****************************************************************
548 * INTERNAL FUNCTIONS *
549 ****************************************************************/
551 static void options_changed(void)
553 GList *next;
555 for (next = all_filer_windows; next; next = next->next)
557 FilerWindow *filer_window = (FilerWindow *) next->data;
558 int flags = 0;
560 if (o_display_dirs_first.has_changed ||
561 o_display_caps_first.has_changed)
562 view_sort(VIEW(filer_window->view));
564 if (o_display_show_headers.has_changed)
565 flags |= VIEW_UPDATE_HEADERS;
567 if (o_large_width.has_changed || o_small_width.has_changed)
568 flags |= VIEW_UPDATE_NAME; /* Recreate PangoLayout */
570 view_style_changed(filer_window->view, flags);
574 /* Return a new string giving details of this item, or NULL if details
575 * are not being displayed. If details are not yet available, return
576 * a string of the right length.
578 static char *details(FilerWindow *filer_window, DirItem *item)
580 mode_t m = item->mode;
581 guchar *buf = NULL;
582 gboolean scanned = item->base_type != TYPE_UNKNOWN;
584 if (filer_window->details_type == DETAILS_NONE)
585 return NULL;
587 if (scanned && item->lstat_errno)
588 buf = g_strdup_printf(_("lstat(2) failed: %s"),
589 g_strerror(item->lstat_errno));
590 else if (filer_window->details_type == DETAILS_TYPE)
592 MIME_type *type = item->mime_type;
594 if (!scanned)
595 return g_strdup("application/octet-stream");
597 buf = g_strdup_printf("%s/%s",
598 type->media_type, type->subtype);
600 else if (filer_window->details_type == DETAILS_TIMES)
602 guchar *ctime, *mtime, *atime;
604 ctime = pretty_time(&item->ctime);
605 mtime = pretty_time(&item->mtime);
606 atime = pretty_time(&item->atime);
608 buf = g_strdup_printf("a[%s] c[%s] m[%s]", atime, ctime, mtime);
609 g_free(ctime);
610 g_free(mtime);
611 g_free(atime);
613 else if (filer_window->details_type == DETAILS_PERMISSIONS)
615 if (!scanned)
616 return g_strdup("---,---,---/--"
617 #ifdef S_ISVTX
619 #endif
620 " 12345678 12345678");
622 buf = g_strdup_printf("%s %-8.8s %-8.8s",
623 pretty_permissions(m),
624 user_name(item->uid),
625 group_name(item->gid));
627 else
629 if (!scanned)
631 if (filer_window->display_style == SMALL_ICONS)
632 return g_strdup("1234M");
633 else
634 return g_strdup("1234 bytes");
637 if (item->base_type != TYPE_DIRECTORY)
639 if (filer_window->display_style == SMALL_ICONS)
640 buf = g_strdup(format_size_aligned(item->size));
641 else
642 buf = g_strdup(format_size(item->size));
644 else
645 buf = g_strdup("-");
648 return buf;
651 /* Note: Call style_changed after this */
652 static void display_details_set(FilerWindow *filer_window, DetailsType details)
654 filer_window->details_type = details;
657 /* Note: Call style_changed after this */
658 static void display_style_set(FilerWindow *filer_window, DisplayStyle style)
660 filer_window->display_style_wanted = style;
661 display_set_actual_size_real(filer_window);
664 /* Each displayed item has a ViewData structure with some cached information
665 * to help quickly draw the item (eg, the PangoLayout). This function updates
666 * this information.
668 void display_update_view(FilerWindow *filer_window,
669 DirItem *item,
670 ViewData *view,
671 gboolean update_name_layout)
673 DisplayStyle style = filer_window->display_style;
674 int w, h;
675 int wrap_width = -1;
676 char *str;
677 static PangoFontDescription *monospace = NULL;
678 PangoAttrList *list = NULL;
680 if (!monospace)
681 monospace = pango_font_description_from_string("monospace");
683 if (view->details)
685 g_object_unref(G_OBJECT(view->details));
686 view->details = NULL;
689 str = details(filer_window, item);
690 if (str)
692 PangoAttrList *details_list;
693 int perm_offset = -1;
695 view->details = gtk_widget_create_pango_layout(
696 filer_window->window, str);
697 g_free(str);
699 pango_layout_set_font_description(view->details, monospace);
700 pango_layout_get_size(view->details, &w, &h);
701 view->details_width = w / PANGO_SCALE;
702 view->details_height = h / PANGO_SCALE;
704 if (filer_window->details_type == DETAILS_PERMISSIONS)
705 perm_offset = 0;
706 if (perm_offset > -1)
708 PangoAttribute *attr;
710 attr = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
712 perm_offset += 4 * applicable(item->uid, item->gid);
713 attr->start_index = perm_offset;
714 attr->end_index = perm_offset + 3;
716 details_list = pango_attr_list_new();
717 pango_attr_list_insert(details_list, attr);
718 pango_layout_set_attributes(view->details,
719 details_list);
723 if (view->image)
725 g_object_unref(view->image);
726 view->image = NULL;
729 if (filer_window->show_thumbs && item->base_type == TYPE_FILE /*&&
730 strcmp(item->mime_type->media_type, "image") == 0*/)
732 const guchar *path;
734 path = make_path(filer_window->real_path, item->leafname);
736 view->image = g_fscache_lookup_full(pixmap_cache, path,
737 FSCACHE_LOOKUP_ONLY_NEW, NULL);
740 if (!view->image)
742 view->image = di_image(item);
743 if (view->image)
744 g_object_ref(view->image);
747 if (view->layout && update_name_layout)
749 g_object_unref(G_OBJECT(view->layout));
750 view->layout = NULL;
753 if (view->layout)
755 /* Do nothing */
757 else if (g_utf8_validate(item->leafname, -1, NULL))
759 view->layout = gtk_widget_create_pango_layout(
760 filer_window->window, item->leafname);
762 else
764 PangoAttribute *attr;
765 gchar *utf8;
767 utf8 = to_utf8(item->leafname);
768 view->layout = gtk_widget_create_pango_layout(
769 filer_window->window, utf8);
770 g_free(utf8);
772 attr = pango_attr_foreground_new(0xffff, 0, 0);
773 attr->start_index = 0;
774 attr->end_index = -1;
775 if (!list)
776 list = pango_attr_list_new();
777 pango_attr_list_insert(list, attr);
780 if (item->flags & ITEM_FLAG_RECENT)
782 PangoAttribute *attr;
784 attr = pango_attr_weight_new(PANGO_WEIGHT_BOLD);
785 attr->start_index = 0;
786 attr->end_index = -1;
787 if (!list)
788 list = pango_attr_list_new();
789 pango_attr_list_insert(list, attr);
792 if (list)
793 pango_layout_set_attributes(view->layout, list);
795 if (filer_window->details_type == DETAILS_NONE)
797 if (style == HUGE_ICONS)
798 wrap_width = HUGE_WRAP * PANGO_SCALE;
799 else if (style == LARGE_ICONS)
800 wrap_width = o_large_width.int_value * PANGO_SCALE;
803 #ifdef USE_PANGO_WRAP_WORD_CHAR
804 pango_layout_set_wrap(view->layout, PANGO_WRAP_WORD_CHAR);
805 #endif
806 if (wrap_width != -1)
807 pango_layout_set_width(view->layout, wrap_width);
809 pango_layout_get_size(view->layout, &w, &h);
810 view->name_width = w / PANGO_SCALE;
811 view->name_height = h / PANGO_SCALE;
814 /* Sets display_style from display_style_wanted.
815 * See also display_set_actual_size().
817 static void display_set_actual_size_real(FilerWindow *filer_window)
819 DisplayStyle size = filer_window->display_style_wanted;
820 int n;
822 g_return_if_fail(filer_window != NULL);
824 if (size == AUTO_SIZE_ICONS)
826 n = view_count_items(filer_window->view);
828 if (n >= o_filer_change_size_num.int_value)
829 size = SMALL_ICONS;
830 else
831 size = LARGE_ICONS;
834 filer_window->display_style = size;