summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-08-14 10:47:41 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-08-14 10:47:41 +0200
commitccbebcbd7adf0663cae9a04b44f094163a3fd157 (patch)
treea683df9359678b50fb704c300754af0364bab7fc
parenteb06701eb3e2b22a156a8a7370dcdda3d3e1d4be (diff)
Add up arrow / down arrow for zooming
-rw-r--r--man/feh.14
-rw-r--r--src/keyevents.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/man/feh.1 b/man/feh.1
index 47fc76d..ebb20f0 100644
--- a/man/feh.1
+++ b/man/feh.1
@@ -631,9 +631,9 @@ Move the image up
Move the image down
.It Aq keypad begin
Antialias the image
-.It Aq keypad +
+.It Ao keypad + Ac , Ao up arrow Ac
Zoom in
-.It Aq keypad -
+.It Ao keypad - Ac , Ao down arrow Ac
Zoom out
.It Aq keypad *
Zoom to 100%
diff --git a/src/keyevents.c b/src/keyevents.c
index b3d48d1..6a5a2d0 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -258,17 +258,20 @@ void feh_event_handle_keypress(XEvent * ev)
winwidget_render_image(winwid, 0, 0);
break;
case XK_KP_Add:
+ case XK_Up:
/* erroneously recognized as '+' in the *kbuf switch. Work around this. */
len = 0;
winwid->zoom = winwid->zoom * 1.25;
- winwidget_sanitise_offsets(winwid);
- winwidget_render_image(winwid, 0, 0);
+ /* TODO: Center only around current view */
+ winwidget_center_image(winwid);
+ winwidget_render_image(winwid, 0, 1);
break;
case XK_KP_Subtract:
+ case XK_Down:
len = 0;
winwid->zoom = winwid->zoom * 0.75;
- winwidget_sanitise_offsets(winwid);
- winwidget_render_image(winwid, 0, 0);
+ winwidget_center_image(winwid);
+ winwidget_render_image(winwid, 0, 1);
break;
case XK_KP_Multiply:
len = 0;