From ccbebcbd7adf0663cae9a04b44f094163a3fd157 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 14 Aug 2010 10:47:41 +0200 Subject: Add up arrow / down arrow for zooming --- src/keyevents.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') 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; -- cgit v1.2.3