aboutsummaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-09-28 00:26:02 +0200
committerBert Münnich <ber.t@posteo.de>2014-09-28 00:28:50 +0200
commit7b91e10f225797cef26ce7094bf2ac6b94901b33 (patch)
treee55bb736a5e1590e6e8548bcf86eedfae29a89b2 /commands.c
parentb2dbd2fed3c9cee72ac3e84036b6b08b169a376e (diff)
downloadnsxiv-7b91e10f225797cef26ce7094bf2ac6b94901b33.tar.zst
Added thumbnail zooming...
- Key mappings +/- are now general commands - Use JPG as thumbnail cache file format instead of PNG - Fixes issue #161
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/commands.c b/commands.c
index 6761946..afe3e00 100644
--- a/commands.c
+++ b/commands.c
@@ -193,6 +193,20 @@ bool cg_scroll_screen(arg_t a)
return tns_scroll(&tns, dir, true);
}
+bool cg_zoom(arg_t a)
+{
+ long d = (long) a;
+
+ if (mode == MODE_THUMB)
+ return tns_zoom(&tns, d);
+ else if (d > 0)
+ return img_zoom_in(&img);
+ else if (d < 0)
+ return img_zoom_out(&img);
+ else
+ return false;
+}
+
bool cg_toggle_image_mark(arg_t a)
{
files[fileidx].marked = !files[fileidx].marked;
@@ -386,18 +400,6 @@ bool ci_drag(arg_t a)
return true;
}
-bool ci_zoom(arg_t a)
-{
- long scale = (long) a;
-
- if (scale > 0)
- return img_zoom_in(&img);
- else if (scale < 0)
- return img_zoom_out(&img);
- else
- return false;
-}
-
bool ci_set_zoom(arg_t a)
{
return img_zoom(&img, (prefix ? prefix : (long) a) / 100.0);