summaryrefslogtreecommitdiff
path: root/src/keyevents.c
diff options
context:
space:
mode:
authorAlec C <avlecxk@gmail.com>2021-03-03 12:02:26 -0800
committerGitHub <noreply@github.com>2021-03-03 21:02:26 +0100
commitb2ce6d8b85cd05964f509c4e00587ac58e3696f3 (patch)
tree707c1139464fc3d6759f55509170c4fbd7cf8256 /src/keyevents.c
parentc91c5ba3f3c374eb4c59327bdf7576bfe1e776f7 (diff)
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 <derf@finalrewind.org>
Diffstat (limited to 'src/keyevents.c')
-rw-r--r--src/keyevents.c4
1 files changed, 2 insertions, 2 deletions
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;