From b2ce6d8b85cd05964f509c4e00587ac58e3696f3 Mon Sep 17 00:00:00 2001 From: Alec C Date: Wed, 3 Mar 2021 12:02:26 -0800 Subject: Option Refactor and addition of Zoom Rate (#589) * fixed for simpler parenthesis matching * absolute file path for .fehbg, moved script creation into helper function * Removed unused variable. * added early exit condition as per Ferada's suggestion * Added enum for options to improve readability * migrated options to enum. * added support for zoom specification through options * added man entry for zoom-rate * added help entry for zoom-rate commands * updated man to have warnings about strange values for zoom options * fix memory leak (free exec_absolute_path) * added detection for path vs env PATH launch for use in .fehbg script gen. * Added enum for options to improve readability * migrated options to enum. * added support for zoom specification through options * added man entry for zoom-rate * added help entry for zoom-rate commands * updated man to have warnings about strange values for zoom options * Update help.raw removed zoom-in/out * removed zoom-in/out from options * updated man/help entry to remove in/out zoom specification * sanitize --zoom-rate in options parser; use a single variable for storing it Co-authored-by: Daniel Friesel --- src/keyevents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/keyevents.c') diff --git a/src/keyevents.c b/src/keyevents.c index 8185167..4d6759a 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -603,7 +603,7 @@ void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysy } else if (feh_is_kp(EVENT_zoom_in, state, keysym, button)) { winwid->old_zoom = winwid->zoom; - winwid->zoom = winwid->zoom * 1.25; + winwid->zoom = winwid->zoom * opt.zoom_rate; if (winwid->zoom > ZOOM_MAX) winwid->zoom = ZOOM_MAX; @@ -617,7 +617,7 @@ void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysy } else if (feh_is_kp(EVENT_zoom_out, state, keysym, button)) { winwid->old_zoom = winwid->zoom; - winwid->zoom = winwid->zoom * 0.80; + winwid->zoom = winwid->zoom / opt.zoom_rate; if (winwid->zoom < ZOOM_MIN) winwid->zoom = ZOOM_MIN; -- cgit v1.2.3