diff options
author | Finn Teegen <finnteegen@googlemail.com> | 2024-01-10 13:34:08 +0100 |
---|---|---|
committer | Birte Friesel <derf@chaosdorf.de> | 2024-06-30 11:55:12 +0200 |
commit | 446f815540fc1608215924513a208340c6a5f7b9 (patch) | |
tree | 9dedda783b547e35472e7c0d30bee01b94048f58 /src | |
parent | 3f455b109b4629b2e3017012aeb2e95e77408c39 (diff) |
Add support for simple tap zones
derf/feh#726
Diffstat (limited to 'src')
-rw-r--r-- | src/events.c | 9 | ||||
-rw-r--r-- | src/help.raw | 1 | ||||
-rw-r--r-- | src/options.c | 4 | ||||
-rw-r--r-- | src/options.h | 2 |
4 files changed, 13 insertions, 3 deletions
diff --git a/src/events.c b/src/events.c index de9e7b3..77798b3 100644 --- a/src/events.c +++ b/src/events.c @@ -366,9 +366,12 @@ static void feh_event_handle_ButtonRelease(XEvent * ev) } else if (opt.mode == MODE_NEXT) { opt.mode = MODE_NORMAL; winwid->mode = MODE_NORMAL; - if (winwid->type == WIN_TYPE_SLIDESHOW) - slideshow_change_image(winwid, SLIDE_NEXT, 1); - else if (winwid->type == WIN_TYPE_THUMBNAIL) { + if (winwid->type == WIN_TYPE_SLIDESHOW) { + if (opt.tap_zones && ev->xbutton.x < winwid->w / 2) + slideshow_change_image(winwid, SLIDE_PREV, 1); + else + slideshow_change_image(winwid, SLIDE_NEXT, 1); + } else if (winwid->type == WIN_TYPE_THUMBNAIL) { feh_file *thumbfile; int x, y; diff --git a/src/help.raw b/src/help.raw index e218e78..0e99c68 100644 --- a/src/help.raw +++ b/src/help.raw @@ -62,6 +62,7 @@ OPTIONS reloads image with \";\", switches to next otherwise --action[1-9] Extra actions triggered by pressing keys <1>to <9> -G, --draw-actions Show the defined actions in the image window + --tap-zones Enable tap zones for previous/next file in slide show mode --force-aliasing Disable antialiasing -m, --montage Enable montage mode -i, --index Create an index print of all images diff --git a/src/options.c b/src/options.c index 266ee0c..3f405fa 100644 --- a/src/options.c +++ b/src/options.c @@ -419,6 +419,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"no-xinerama" , 0, 0, OPTION_no_xinerama}, {"draw-tinted" , 0, 0, OPTION_draw_tinted}, {"info" , 1, 0, OPTION_info}, + {"tap-zones" , 0, 0, OPTION_tap_zones}, {"force-aliasing", 0, 0, OPTION_force_aliasing}, {"no-fehbg" , 0, 0, OPTION_no_fehbg}, {"keep-zoom-vp" , 0, 0, OPTION_keep_zoom_vp}, @@ -783,6 +784,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) opt.draw_info = 1; } break; + case OPTION_tap_zones: + opt.tap_zones = 1; + break; case OPTION_force_aliasing: opt.force_aliasing = 1; break; diff --git a/src/options.h b/src/options.h index aa3cd91..2aed6a6 100644 --- a/src/options.h +++ b/src/options.h @@ -107,6 +107,7 @@ struct __fehoptions { char *index_info; int force_aliasing; + int tap_zones; int thumb_w; int thumb_h; int limit_w; @@ -239,6 +240,7 @@ OPTION_auto_rotate, OPTION_no_xinerama, OPTION_draw_tinted, OPTION_info, +OPTION_tap_zones, OPTION_force_aliasing, OPTION_no_fehbg, OPTION_scroll_step, |