Krolyxon
Commit ff2ce99

Branches

Refs →

nsxivff2ce99

Merge djhejna/floatdelay

Author
Bert Münnich
Date
2016-12-01 20:33 +0100
Committer
Bert Münnich · 2016-12-01 21:18 +0100
Parents
9a85dd4 27bbaab
Commit
ff2ce99bf7dc08ce8eae47dd980c7af60ad51197

+17 −9

6 files changed

  1. M Makefile +1 −1
  2. M commands.c +2 −2
  3. M image.c +1 −1
  4. M main.c +7 −3
  5. M options.c +1 −1
  6. M sxiv.1 +5 −1
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION := git-20161129
1+VERSION := git-20161201
22
33 PREFIX := /usr/local
44 MANPREFIX := $(PREFIX)/share/man
M commands.c View
@@ -429,8 +429,8 @@ bool ci_slideshow(arg_t _)
429429 {
430430 if (prefix > 0) {
431431 img.ss.on = true;
432− img.ss.delay = prefix;
433− set_timeout(slideshow, img.ss.delay * 1000, true);
432+ img.ss.delay = prefix * 10;
433+ set_timeout(slideshow, img.ss.delay * 100, true);
434434 } else if (img.ss.on) {
435435 img.ss.on = false;
436436 reset_timeout(slideshow);
M image.c View
@@ -76,7 +76,7 @@ void img_init(img_t *img, win_t *win)
7676 img->gamma = MIN(MAX(options->gamma, -GAMMA_RANGE), GAMMA_RANGE);
7777
7878 img->ss.on = options->slideshow > 0;
79− img->ss.delay = options->slideshow > 0 ? options->slideshow : SLIDESHOW_DELAY;
79+ img->ss.delay = options->slideshow > 0 ? options->slideshow : SLIDESHOW_DELAY * 10;
8080 }
8181
8282 #if HAVE_LIBEXIF
M main.c View
@@ -371,8 +371,12 @@ void update_info(void)
371371 bar_put(r, "%s%0*d/%d", mark, fw, fileidx + 1, filecnt);
372372 } else {
373373 bar_put(r, "%s", mark);
374− if (img.ss.on)
375− bar_put(r, "%ds | ", img.ss.delay);
374+ if (img.ss.on) {
375+ if (img.ss.delay % 10 != 0)
376+ bar_put(r, "%2.1fs | ", (float)img.ss.delay / 10);
377+ else
378+ bar_put(r, "%ds | ", img.ss.delay / 10);
379+ }
376380 if (img.gamma != 0)
377381 bar_put(r, "G%+d | ", img.gamma);
378382 bar_put(r, "%3d%% | ", (int) (img.zoom * 100.0));
@@ -403,7 +407,7 @@ void redraw(void)
403407 if (mode == MODE_IMAGE) {
404408 img_render(&img);
405409 if (img.ss.on) {
406− t = img.ss.delay * 1000;
410+ t = img.ss.delay * 100;
407411 if (img.multi.cnt > 0 && img.multi.animate)
408412 t = MAX(t, img.multi.length);
409413 set_timeout(slideshow, t, false);
M options.c View
@@ -136,7 +136,7 @@ void parse_options(int argc, char **argv)
136136 _options.recursive = true;
137137 break;
138138 case 'S':
139− n = strtol(optarg, &end, 0);
139+ n = strtof(optarg, &end) * 10;
140140 if (*end != '\0' || n <= 0)
141141 error(EXIT_FAILURE, 0, "Invalid argument for option -S: %s", optarg);
142142 _options.slideshow = n;
M sxiv.1 View
@@ -87,7 +87,11 @@ Be quiet, disable warnings to standard error stream.
8787 Search the given directories recursively for images to view.
8888 .TP
8989 .BI "\-S " DELAY
90−Start in slideshow mode. Set the delay between images to DELAY seconds.
90+Start in slideshow mode. Set the delay between images to
91+.I DELAY
92+seconds.
93+.I DELAY
94+may be a floating point number.
9195 .TP
9296 .BI "\-s " MODE
9397 Set scale mode according to MODE character. Supported modes are: [d]own,