Added it_toggle_bar command; default mapping: XK_b
This commit is contained in:
parent
011dac90c8
commit
c666d30eea
|
@ -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
|
||||
|
|
10
commands.c
10
commands.c
|
@ -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);
|
||||
|
|
|
@ -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 },
|
||||
|
|
3
sxiv.1
3
sxiv.1
|
@ -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
|
||||
|
|
13
window.c
13
window.c
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue