layout_status_update_progress(lw, val, text);
}
+static void layout_list_sync_thumb(LayoutWindow *lw)
+{
+ if (lw->vf) vf_thumb_set(lw->vf, lw->options.show_thumbnails);
+}
+
static GtkWidget *layout_list_new(LayoutWindow *lw)
{
lw->vf = vf_new(lw->options.file_view_type, NULL);
vf_set_thumb_status_func(lw->vf, layout_list_thumb_cb, lw);
vf_marks_set(lw->vf, lw->options.show_marks);
-
- switch (lw->options.file_view_type)
- {
- case FILEVIEW_ICON:
- break;
- case FILEVIEW_LIST:
- vf_thumb_set(lw->vf, lw->options.show_thumbnails);
- break;
- }
+
+ layout_list_sync_thumb(lw);
return lw->vf->widget;
}
-static void layout_list_sync_thumb(LayoutWindow *lw)
-{
- if (lw->vf) vf_thumb_set(lw->vf, lw->options.show_thumbnails);
-}
-
static void layout_list_sync_marks(LayoutWindow *lw)
{
if (lw->vf) vf_marks_set(lw->vf, lw->options.show_marks);
{
if (lw->vd) vd_refresh(lw->vd);
- if (lw->vf) vf_refresh(lw->vf);
+ if (lw->vf)
+ {
+ vf_refresh(lw->vf);
+ vf_thumb_update(lw->vf);
+ }
}
void layout_refresh(LayoutWindow *lw)
#include <pwd.h>
#endif
-
+gboolean thumb_format_changed = FALSE;
static RemoteConnection *remote_connection = NULL;
-
/*
*-----------------------------------------------------------------------------
* keyboard functions
* This also doubles as the main.c header.
*/
+extern gboolean thumb_format_changed;
+
void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event);
gint key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
options->image.limit_autofit_size = c_options->image.limit_autofit_size;
options->image.max_autofit_size = c_options->image.max_autofit_size;
options->progressive_key_scrolling = c_options->progressive_key_scrolling;
- options->thumbnails.max_width = c_options->thumbnails.max_width;
- options->thumbnails.max_height = c_options->thumbnails.max_height;
+ if (options->thumbnails.max_width != c_options->thumbnails.max_width
+ || options->thumbnails.max_height != c_options->thumbnails.max_height
+ || options->thumbnails.quality != c_options->thumbnails.quality)
+ {
+ thumb_format_changed = TRUE;
+ refresh = TRUE;
+ options->thumbnails.max_width = c_options->thumbnails.max_width;
+ options->thumbnails.max_height = c_options->thumbnails.max_height;
+ options->thumbnails.quality = c_options->thumbnails.quality;
+ }
options->thumbnails.enable_caching = c_options->thumbnails.enable_caching;
options->thumbnails.cache_into_dirs = c_options->thumbnails.cache_into_dirs;
options->thumbnails.fast = c_options->thumbnails.fast;
options->image.read_buffer_size = c_options->image.read_buffer_size;
options->image.idle_read_loop_count = c_options->image.idle_read_loop_count;
- options->thumbnails.quality = c_options->thumbnails.quality;
options->image.zoom_quality = c_options->image.zoom_quality;
options->image.zoom_increment = c_options->image.zoom_increment;
return menu;
}
+void vf_thumb_update(ViewFile *vf)
+{
+ switch (vf->type)
+ {
+ case FILEVIEW_LIST: vflist_thumb_update(vf); break;
+ case FILEVIEW_ICON: vficon_thumb_update(vf); break;
+ }
+}
+
gboolean vf_refresh(ViewFile *vf)
{
gboolean ret = FALSE;
void vf_refresh_idle_cancel(ViewFile *vf);
void vf_notify_cb(FileData *fd, NotifyType type, gpointer data);
+void vf_thumb_update(ViewFile *vf);
+
#endif /* VIEW_FILE_H */
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
static void vficon_selection_remove(ViewFile *vf, IconData *id, SelectionType mask, GtkTreeIter *iter);
static void vficon_move_focus(ViewFile *vf, gint row, gint col, gboolean relative);
static void vficon_set_focus(ViewFile *vf, IconData *id);
-static void vficon_thumb_update(ViewFile *vf);
static void vficon_populate_at_new_size(ViewFile *vf, gint w, gint h, gboolean force);
return FALSE;
}
-static void vficon_thumb_update(ViewFile *vf)
+void vficon_thumb_update(ViewFile *vf)
{
vficon_thumb_stop(vf);
vficon_thumb_status(vf, 0.0, _("Loading thumbs..."));
vf->thumbs_running = TRUE;
+
+ if (thumb_format_changed)
+ {
+ GList *work = vf->list;
+ while (work)
+ {
+ IconData *id = work->data;
+ FileData *fd = id->fd;
+ if (fd->thumb_pixbuf)
+ {
+ g_object_unref(fd->thumb_pixbuf);
+ fd->thumb_pixbuf = NULL;
+ }
+ work = work->next;
+ }
+
+ thumb_format_changed = FALSE;
+ }
while (vficon_thumb_next(vf));
}
void vficon_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode);
void vficon_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode);
+void vficon_thumb_update(ViewFile *vf);
+
#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
GtkTreeModel *store;
GtkTreeIter iter;
gboolean valid = TRUE;
-
+
store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview));
gtk_tree_model_get_iter(store, &iter, tpath);
gtk_tree_path_free(tpath);
while (!fd && valid && tree_view_row_get_visibility(GTK_TREE_VIEW(vf->listview), &iter, FALSE) == 0)
{
- gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &fd, -1);
- if (fd->thumb_pixbuf) fd = NULL;
+ FileData *nfd;
+
+ gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &nfd, -1);
+
+ if (!nfd->thumb_pixbuf) fd = nfd;
valid = gtk_tree_model_iter_next(store, &iter);
}
return FALSE;
}
-static void vflist_thumb_update(ViewFile *vf)
+void vflist_thumb_update(ViewFile *vf)
{
vflist_thumb_stop(vf);
if (!VFLIST(vf)->thumbs_enabled) return;
vflist_thumb_status(vf, 0.0, _("Loading thumbs..."));
vf->thumbs_running = TRUE;
+ if (thumb_format_changed)
+ {
+ GList *work = vf->list;
+ while (work)
+ {
+ FileData *fd = work->data;
+ if (fd->thumb_pixbuf)
+ {
+ g_object_unref(fd->thumb_pixbuf);
+ fd->thumb_pixbuf = NULL;
+ }
+ work = work->next;
+ }
+
+ thumb_format_changed = FALSE;
+ }
+
while (vflist_thumb_next(vf));
}
void vflist_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode);
void vflist_color_set(ViewFile *vf, FileData *fd, gboolean color_set);
+void vflist_thumb_update(ViewFile *vf);
#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */