diff options
author | Bert Münnich <ber.t@posteo.de> | 2016-12-01 20:33:24 +0100 |
---|---|---|
committer | Bert Münnich <ber.t@posteo.de> | 2016-12-01 21:18:41 +0100 |
commit | ff2ce99bf7dc08ce8eae47dd980c7af60ad51197 (patch) | |
tree | 5a96b7fc9d021f31fbce6c847efcfee7d4d79269 | |
parent | 9a85dd41d8551f82a5d00c8e0dd0807e23bbdc6d (diff) | |
parent | 27bbaab976e02d2458099de96ec71d14aa1ade8e (diff) |
Merge djhejna/floatdelay
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | commands.c | 4 | ||||
-rw-r--r-- | image.c | 2 | ||||
-rw-r--r-- | main.c | 10 | ||||
-rw-r--r-- | options.c | 2 | ||||
-rw-r--r-- | sxiv.1 | 6 |
6 files changed, 17 insertions, 9 deletions
@@ -1,4 +1,4 @@ -VERSION := git-20161129 +VERSION := git-20161201 PREFIX := /usr/local MANPREFIX := $(PREFIX)/share/man @@ -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); @@ -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 @@ -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); @@ -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; @@ -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, |