From 0bab331e21a046a1ec775f188feadd300c9a57f8 Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Thu, 29 Sep 2011 15:37:23 +0200 Subject: Thumbnail view now allows to execute actions. Only if a previously selected item (mouse over, keyboard) is available though. --- src/keyevents.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/keyevents.c') diff --git a/src/keyevents.c b/src/keyevents.c index 827ab24..64194da 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -345,10 +345,21 @@ void feh_event_invoke_action(winwidget winwid, unsigned char action) feh_reload_image(winwid, 1, 1); else winwidget_destroy(winwid); - } else if (winwid->type == WIN_TYPE_THUMBNAIL) - fputs("actions from the main thumb window aren't currently supported!\n" - "For now, open the image to perform the action on it.\n", - stdout); + } else if (winwid->type == WIN_TYPE_THUMBNAIL) { + feh_file *thumbfile; + /* also see events.c:306 */ + thumbfile = feh_thumbnail_get_selected_file(); + + if (thumbfile) { + feh_action_run(thumbfile, opt.actions[action]); + + /* so, reload/regenerate the thumbnail here? */ + if (!opt.hold_actions[action]) + winwidget_destroy(winwid); + } + else + fputs("no thumbnail selected\n", stderr); + } } return; } -- cgit v1.2.3