sxiv

simple X image viewer
git clone git://git.suckless.org/sxiv
Log | Files | Refs | LICENSE

commit ff2ce99bf7dc08ce8eae47dd980c7af60ad51197
parent 9a85dd41d8551f82a5d00c8e0dd0807e23bbdc6d
Author: Bert M√ľnnich <ber.t@posteo.de>
Date:   Thu,  1 Dec 2016 20:33:24 +0100

Merge djhejna/floatdelay

Diffstat:
Makefile | 2+-
commands.c | 4++--
image.c | 2+-
main.c | 10+++++++---
options.c | 2+-
sxiv.1 | 6+++++-
6 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,4 +1,4 @@ -VERSION := git-20161129 +VERSION := git-20161201 PREFIX := /usr/local MANPREFIX := $(PREFIX)/share/man diff --git a/commands.c b/commands.c @@ -429,8 +429,8 @@ bool ci_slideshow(arg_t _) { if (prefix > 0) { img.ss.on = true; - img.ss.delay = prefix; - set_timeout(slideshow, img.ss.delay * 1000, true); + img.ss.delay = prefix * 10; + set_timeout(slideshow, img.ss.delay * 100, true); } else if (img.ss.on) { img.ss.on = false; reset_timeout(slideshow); diff --git a/image.c b/image.c @@ -76,7 +76,7 @@ void img_init(img_t *img, win_t *win) img->gamma = MIN(MAX(options->gamma, -GAMMA_RANGE), GAMMA_RANGE); img->ss.on = options->slideshow > 0; - img->ss.delay = options->slideshow > 0 ? options->slideshow : SLIDESHOW_DELAY; + img->ss.delay = options->slideshow > 0 ? options->slideshow : SLIDESHOW_DELAY * 10; } #if HAVE_LIBEXIF diff --git a/main.c b/main.c @@ -371,8 +371,12 @@ void update_info(void) bar_put(r, "%s%0*d/%d", mark, fw, fileidx + 1, filecnt); } else { bar_put(r, "%s", mark); - if (img.ss.on) - bar_put(r, "%ds | ", img.ss.delay); + if (img.ss.on) { + if (img.ss.delay % 10 != 0) + bar_put(r, "%2.1fs | ", (float)img.ss.delay / 10); + else + bar_put(r, "%ds | ", img.ss.delay / 10); + } if (img.gamma != 0) bar_put(r, "G%+d | ", img.gamma); bar_put(r, "%3d%% | ", (int) (img.zoom * 100.0)); @@ -403,7 +407,7 @@ void redraw(void) if (mode == MODE_IMAGE) { img_render(&img); if (img.ss.on) { - t = img.ss.delay * 1000; + t = img.ss.delay * 100; if (img.multi.cnt > 0 && img.multi.animate) t = MAX(t, img.multi.length); set_timeout(slideshow, t, false); diff --git a/options.c b/options.c @@ -136,7 +136,7 @@ void parse_options(int argc, char **argv) _options.recursive = true; break; case 'S': - n = strtol(optarg, &end, 0); + n = strtof(optarg, &end) * 10; if (*end != '\0' || n <= 0) error(EXIT_FAILURE, 0, "Invalid argument for option -S: %s", optarg); _options.slideshow = n; diff --git a/sxiv.1 b/sxiv.1 @@ -87,7 +87,11 @@ Be quiet, disable warnings to standard error stream. Search the given directories recursively for images to view. .TP .BI "\-S " DELAY -Start in slideshow mode. Set the delay between images to DELAY seconds. +Start in slideshow mode. Set the delay between images to +.I DELAY +seconds. +.I DELAY +may be a floating point number. .TP .BI "\-s " MODE Set scale mode according to MODE character. Supported modes are: [d]own,