diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | commands.c | 10 | ||||
-rw-r--r-- | commands.h | 1 | ||||
-rw-r--r-- | config.def.h | 1 | ||||
-rw-r--r-- | sxiv.1 | 3 | ||||
-rw-r--r-- | window.c | 13 | ||||
-rw-r--r-- | window.h | 1 |
7 files changed, 30 insertions, 0 deletions
@@ -88,6 +88,7 @@ The following general key commands are available: f Toggle fullscreen mode (requires an EWMH/NetWM compliant window manager) + b Toggle visibility of info bar on bottom of window A Toggle visibility of alpha-channel, i.e. transparency r Reload image @@ -76,6 +76,7 @@ bool it_switch_mode(arg_t a) { bool it_toggle_fullscreen(arg_t a) { win_toggle_fullscreen(&win); + /* redraw after next ConfigureNotify event */ set_timeout(redraw, TO_REDRAW_RESIZE, false); if (mode == MODE_IMAGE) img.checkpan = true; @@ -84,6 +85,15 @@ bool it_toggle_fullscreen(arg_t a) { return false; } +bool it_toggle_bar(arg_t a) { + win_toggle_bar(&win); + if (mode == MODE_IMAGE) + img.checkpan = img.dirty = true; + else + tns.dirty = true; + return true; +} + bool it_reload_image(arg_t a) { if (mode == MODE_IMAGE) { load_image(fileidx); @@ -44,6 +44,7 @@ typedef struct { bool it_quit(arg_t); bool it_switch_mode(arg_t); bool it_toggle_fullscreen(arg_t); +bool it_toggle_bar(arg_t); bool it_reload_image(arg_t); bool it_remove_image(arg_t); bool i_navigate(arg_t); diff --git a/config.def.h b/config.def.h index 9dbd74d..1a38e84 100644 --- a/config.def.h +++ b/config.def.h @@ -60,6 +60,7 @@ static const keymap_t keys[] = { { false, XK_q, it_quit, (arg_t) None }, { false, XK_Return, it_switch_mode, (arg_t) None }, { false, XK_f, it_toggle_fullscreen, (arg_t) None }, + { false, XK_b, it_toggle_bar, (arg_t) None }, { false, XK_r, it_reload_image, (arg_t) None }, { false, XK_D, it_remove_image, (arg_t) None }, @@ -105,6 +105,9 @@ Go to the last image, or image number .B f Toggle fullscreen mode. .TP +.B b +Toggle visibility of info bar on bottom of window. +.TP .B A Toggle visibility of alpha-channel, i.e. image transparency. .TP @@ -306,6 +306,19 @@ void win_toggle_fullscreen(win_t *win) { SubstructureNotifyMask | SubstructureRedirectMask, &ev); } +void win_toggle_bar(win_t *win) { + if (win == NULL || win->xwin == None) + return; + + if (win->barh != 0) { + win->h += win->barh; + win->barh = 0; + } else { + win->barh = font.ascent + font.descent + 2 * V_TEXT_PAD; + win->h -= win->barh; + } +} + void win_clear(win_t *win) { win_env_t *e; @@ -69,6 +69,7 @@ bool win_configure(win_t*, XConfigureEvent*); bool win_moveresize(win_t*, int, int, unsigned int, unsigned int); void win_toggle_fullscreen(win_t*); +void win_toggle_bar(win_t*); void win_clear(win_t*); void win_draw(win_t*); |