summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-06-07 12:17:21 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-06-07 12:17:21 +0200
commit20dc3679e2ed4840c7b4db9aca43361222214199 (patch)
tree2661714aed1f1ce37dd0ec53dd953f312880b8c1
parent481a0ec264aab1509f83334e66d929154ceb1d74 (diff)
Add toggle_info key (closes #48)
-rw-r--r--ChangeLog2
-rw-r--r--man/feh.pre5
-rw-r--r--src/keyevents.c7
-rw-r--r--src/options.c1
-rw-r--r--src/options.h2
-rw-r--r--src/winwidget.c4
6 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e9ef83..134b1e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@ git HEAD
<https://github.com/derf/feh/issues/45>
* Use --zoom 100 to show all images at 100% in --fullscreen mode
<https://github.com/derf/feh/issues/47>
+ * Add toggle_info key to switch --info display on/off (defaults to 'i')
+ <https://github.com/derf/feh/issues/48>
Thu, 19 May 2011 22:32:42 +0200 Daniel Friesel <derf@finalrewind.org>
diff --git a/man/feh.pre b/man/feh.pre
index c3da251..9a541b7 100644
--- a/man/feh.pre
+++ b/man/feh.pre
@@ -940,6 +940,11 @@ Pause/Continue the slideshow. When it is paused, it will not automatically
change slides based on
.Cm --slideshow-delay .
.
+.It i Bq toggle_info
+.
+Toggle info display
+.Pq see Cm --info
+.
.It m Bq toggle_menu
.
Show menu. Use the arrow keys and return to select items,
diff --git a/src/keyevents.c b/src/keyevents.c
index c44667f..ddfe782 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -127,6 +127,7 @@ void init_keyevents(void) {
feh_set_kb(&keys.toggle_actions, 0, XK_a, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_aliasing, 0, XK_A, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_filenames, 0, XK_d, 0, 0, 0, 0);
+ feh_set_kb(&keys.toggle_info, 0, XK_i, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_pointer, 0, XK_o, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_caption, 0, XK_c, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_pause, 0, XK_h, 0, 0, 0, 0);
@@ -250,6 +251,8 @@ void init_keyevents(void) {
cur_kb = &keys.toggle_aliasing;
else if (!strcmp(action, "toggle_filenames"))
cur_kb = &keys.toggle_filenames;
+ else if (!strcmp(action, "toggle_info"))
+ cur_kb = &keys.toggle_info;
else if (!strcmp(action, "toggle_pointer"))
cur_kb = &keys.toggle_pointer;
else if (!strcmp(action, "toggle_caption"))
@@ -564,6 +567,10 @@ void feh_event_handle_keypress(XEvent * ev)
opt.draw_filename = !opt.draw_filename;
winwidget_rerender_all(0);
}
+ else if (feh_is_kp(&keys.toggle_info, keysym, state)) {
+ opt.draw_info = !opt.draw_info;
+ winwidget_rerender_all(0);
+ }
else if (feh_is_kp(&keys.toggle_pointer, keysym, state)) {
winwidget_set_pointer(winwid, opt.hide_pointer);
opt.hide_pointer = !opt.hide_pointer;
diff --git a/src/options.c b/src/options.c
index f4d4029..b5a95dd 100644
--- a/src/options.c
+++ b/src/options.c
@@ -772,6 +772,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
break;
case 234:
opt.info_cmd = estrdup(optarg);
+ opt.draw_info = 1;
break;
case 235:
opt.force_aliasing = 1;
diff --git a/src/options.h b/src/options.h
index 431fdfc..f0015c9 100644
--- a/src/options.h
+++ b/src/options.h
@@ -68,6 +68,7 @@ struct __fehoptions {
unsigned char screen_clip;
unsigned char hide_pointer;
unsigned char draw_actions;
+ unsigned char draw_info;
unsigned char cache_thumbnails;
unsigned char cycle_once;
unsigned char hold_actions[10];
@@ -175,6 +176,7 @@ struct __fehkb {
struct __fehkey render;
struct __fehkey toggle_actions;
struct __fehkey toggle_filenames;
+ struct __fehkey toggle_info;
struct __fehkey toggle_pointer;
struct __fehkey toggle_aliasing;
struct __fehkey jump_random;
diff --git a/src/winwidget.c b/src/winwidget.c
index 57a8b1d..a678781 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -562,7 +562,7 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
feh_draw_filename(winwid);
if (opt.draw_actions)
feh_draw_actions(winwid);
- if (opt.info_cmd)
+ if (opt.draw_info && opt.info_cmd)
feh_draw_info(winwid);
if (winwid->errstr)
feh_draw_errstr(winwid);
@@ -589,7 +589,7 @@ void winwidget_render_image_cached(winwidget winwid)
feh_draw_filename(winwid);
if (opt.draw_actions)
feh_draw_actions(winwid);
- if (opt.info_cmd)
+ if (opt.draw_info && opt.info_cmd)
feh_draw_info(winwid);
XSetWindowBackgroundPixmap(disp, winwid->win, winwid->bg_pmap);
XClearWindow(disp, winwid->win);