summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-04-14 20:10:54 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-04-14 20:10:54 +0200
commitbbdb885d9cc40077bf50a6d13be74b9d07a50e59 (patch)
treeff764b9b3ecccc1eab62a9d0ebd3fc5434c5e770 /src
parent60f6a93e10612ab9edf8e10ccaabbca756142f0c (diff)
add --scroll-step option
Diffstat (limited to 'src')
-rw-r--r--src/keyevents.c8
-rw-r--r--src/options.c5
-rw-r--r--src/options.h3
3 files changed, 12 insertions, 4 deletions
diff --git a/src/keyevents.c b/src/keyevents.c
index 9bda112..97acb3e 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -481,22 +481,22 @@ void feh_event_handle_keypress(XEvent * ev)
feh_thumbnail_select_prev(winwid, 1);
}
else if (feh_is_kp(&keys.scroll_right, keysym, state)) {
- winwid->im_x -= 20;
+ winwid->im_x -= opt.scroll_step;;
winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_left, keysym, state)) {
- winwid->im_x += 20;
+ winwid->im_x += opt.scroll_step;
winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_down, keysym, state)) {
- winwid->im_y -= 20;
+ winwid->im_y -= opt.scroll_step;
winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_up, keysym, state)) {
- winwid->im_y += 20;
+ winwid->im_y += opt.scroll_step;
winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 1);
}
diff --git a/src/options.c b/src/options.c
index c6166d9..7542cd5 100644
--- a/src/options.c
+++ b/src/options.c
@@ -57,6 +57,7 @@ void init_parse_options(int argc, char **argv)
opt.thumb_w = 60;
opt.thumb_h = 60;
opt.thumb_redraw = 10;
+ opt.scroll_step = 20;
opt.menu_font = estrdup(DEFAULT_MENU_FONT);
opt.font = NULL;
opt.menu_bg = estrdup(PREFIX "/share/feh/images/menubg_default.png");
@@ -398,6 +399,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
{"force-aliasing", 0, 0, 235},
{"no-fehbg" , 0, 0, 236},
{"keep-zoom-vp" , 0, 0, 237},
+ {"scroll-step" , 1, 0, 238},
{0, 0, 0, 0}
};
@@ -731,6 +733,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
case 237:
opt.keep_zoom_vp = 1;
break;
+ case 238:
+ opt.scroll_step = atoi(optarg);
+ break;
default:
break;
}
diff --git a/src/options.h b/src/options.h
index 27d3d38..a22cc05 100644
--- a/src/options.h
+++ b/src/options.h
@@ -110,6 +110,9 @@ struct __fehoptions {
int zoom_mode;
unsigned char adjust_reload;
+ /* signed in case someone wants to invert scrolling real quick */
+ int scroll_step;
+
unsigned int min_width, min_height, max_width, max_height;
unsigned char mode;