summaryrefslogtreecommitdiff
path: root/src/slideshow.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-08-11 20:30:06 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-08-11 20:34:58 +0200
commit64e9c952f0bbd5c23fd775620f3df1c261799ed6 (patch)
tree9bbd40e8ed8af7f17664269f59ce10c27a1215bd /src/slideshow.c
parent03e54647e9ffd21a47cd608f662b5e2cb9a0f7c5 (diff)
Show correct file number after deleting image
In the image_remove function, slideshow_change_image needs to be called before removing the image from the filelist. Because of this, the "x of y" displayed by --draw-filename is wrong (y is 1 too high). This commit introduces a new 'render' argument to slideshow_chingae_image. The image_remove function calls it with render=0, edits the filelist and then runs by winwidget_render_image itself. Patch by Yu-Jie Lin.
Diffstat (limited to 'src/slideshow.c')
-rw-r--r--src/slideshow.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index 25fca03..f33ae9e 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -83,7 +83,7 @@ void init_slideshow_mode(void)
void cb_slide_timer(void *data)
{
- slideshow_change_image((winwidget) data, SLIDE_NEXT);
+ slideshow_change_image((winwidget) data, SLIDE_NEXT, 1);
return;
}
@@ -170,7 +170,7 @@ void feh_reload_image(winwidget w, int resize, int force_new)
return;
}
-void slideshow_change_image(winwidget winwid, int change)
+void slideshow_change_image(winwidget winwid, int change, int render)
{
gib_list *last = NULL;
int i = 0;
@@ -260,7 +260,8 @@ void slideshow_change_image(winwidget winwid, int change)
winwidget_reset_image(winwid);
winwid->im_w = gib_imlib_image_get_width(winwid->im);
winwid->im_h = gib_imlib_image_get_height(winwid->im);
- winwidget_render_image(winwid, 1, 0);
+ if (render)
+ winwidget_render_image(winwid, 1, 0);
s = slideshow_create_name(FEH_FILE(current_file->data));
winwidget_rename(winwid, s);
@@ -428,7 +429,7 @@ void feh_filelist_image_remove(winwidget winwid, char do_delete)
gib_list *doomed;
doomed = current_file;
- slideshow_change_image(winwid, SLIDE_NEXT);
+ slideshow_change_image(winwid, SLIDE_NEXT, 0);
if (do_delete)
filelist = feh_file_rm_and_free(filelist, doomed);
else
@@ -441,6 +442,7 @@ void feh_filelist_image_remove(winwidget winwid, char do_delete)
s = slideshow_create_name(FEH_FILE(winwid->file->data));
winwidget_rename(winwid, s);
free(s);
+ winwidget_render_image(winwid, 1, 0);
} else if ((winwid->type == WIN_TYPE_SINGLE)
|| (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER)) {
if (do_delete)