diff options
Diffstat (limited to 'src/slideshow.c')
-rw-r--r-- | src/slideshow.c | 61 |
1 files changed, 15 insertions, 46 deletions
diff --git a/src/slideshow.c b/src/slideshow.c index effdcaf..b27a7e8 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -1,7 +1,7 @@ /* slideshow.c Copyright (C) 1999-2003 Tom Gilbert. -Copyright (C) 2010-2011 Daniel Friesel. +Copyright (C) 2010-2018 Daniel Friesel. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -143,16 +143,6 @@ void feh_reload_image(winwidget w, int resize, int force_new) Imlib_Image tmp; int old_w, old_h; - unsigned char tmode =0; - int tim_x =0; - int tim_y =0; - double tzoom =0; - - tmode = w->mode; - tim_x = w->im_x; - tim_y = w->im_y; - tzoom = w->zoom; - if (!w->file) { im_weprintf(w, "couldn't reload, this image has no file associated with it."); winwidget_render_image(w, 0, 0); @@ -217,16 +207,7 @@ void feh_reload_image(winwidget w, int resize, int force_new) w->im_w = gib_imlib_image_get_width(w->im); w->im_h = gib_imlib_image_get_height(w->im); } - if (opt.keep_zoom_vp) { - /* put back in: */ - w->mode = tmode; - w->im_x = tim_x; - w->im_y = tim_y; - w->zoom = tzoom; - winwidget_render_image(w, 0, 0); - } else { - winwidget_render_image(w, resize, 0); - } + winwidget_render_image(w, resize, 0); return; } @@ -241,11 +222,6 @@ void slideshow_change_image(winwidget winwid, int change, int render) */ int our_filelist_len = filelist_len; - unsigned char tmode =0; - int tim_x =0; - int tim_y =0; - double tzoom =0; - /* Without this, clicking a one-image slideshow reloads it. Not very * intelligent behaviour :-) */ if (filelist_len < 2 && opt.cycle_once == 0) @@ -356,14 +332,6 @@ void slideshow_change_image(winwidget winwid, int change, int render) last = NULL; } - if (opt.keep_zoom_vp) { - /* pre loadimage - record settings */ - tmode = winwid->mode; - tim_x = winwid->im_x; - tim_y = winwid->im_y; - tzoom = winwid->zoom; - } - if (winwidget_loadimage(winwid, FEH_FILE(current_file->data))) { int w = gib_imlib_image_get_width(winwid->im); int h = gib_imlib_image_get_height(winwid->im); @@ -378,19 +346,8 @@ void slideshow_change_image(winwidget winwid, int change, int render) winwidget_reset_image(winwid); winwid->im_w = w; winwid->im_h = h; - if (opt.keep_zoom_vp) { - /* put back in: */ - winwid->mode = tmode; - winwid->im_x = tim_x; - winwid->im_y = tim_y; - winwid->zoom = tzoom; - } if (render) { - if (opt.keep_zoom_vp) { - winwidget_render_image(winwid, 0, 0); - } else { - winwidget_render_image(winwid, 1, 0); - } + winwidget_render_image(winwid, 1, 0); } break; } else @@ -468,6 +425,12 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid) if (file) strncat(ret, shell_escape(file->filename), sizeof(ret) - strlen(ret) - 1); break; + case 'g': + if (winwid) { + snprintf(buf, sizeof(buf), "%d,%d", winwid->w, winwid->h); + strncat(ret, buf, sizeof(ret) - strlen(ret) - 1); + } + break; case 'h': if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->height); @@ -564,6 +527,12 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid) strncat(ret, "1.00", sizeof(ret) - strlen(ret) - 1); } break; + case 'Z': + if (winwid) { + snprintf(buf, sizeof(buf), "%f", winwid->zoom); + strncat(ret, buf, sizeof(ret) - strlen(ret) - 1); + } + break; case '%': strncat(ret, "%", sizeof(ret) - strlen(ret) - 1); break; |