aboutsummaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-04-06 22:47:42 +0200
committerBert Münnich <ber.t@posteo.de>2014-04-06 22:47:42 +0200
commite685859a30560e076db4de003fba4e4500ade2c7 (patch)
tree8372fdc425be8bbd876dd931bbb30c6fd82bed06 /commands.c
parent6d7acac3d132c5be09a9a4e8d0f4ebd4972e9385 (diff)
downloadnsxiv-e685859a30560e076db4de003fba4e4500ade2c7.tar.zst
Use a checkerboard background for alpha layer; fixes issue #138
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/commands.c b/commands.c
index 1d1c8b3..ecc3c4c 100644
--- a/commands.c
+++ b/commands.c
@@ -75,10 +75,8 @@ cmdreturn_t it_quit(arg_t a)
cmdreturn_t it_switch_mode(arg_t a)
{
if (mode == MODE_IMAGE) {
- if (tns.thumbs == NULL) {
+ if (tns.thumbs == NULL)
tns_init(&tns, filecnt, &win);
- tns.alpha = img.alpha;
- }
img_close(&img, false);
reset_timeout(reset_cursor);
if (img.ss.on) {
@@ -494,14 +492,15 @@ cmdreturn_t i_toggle_antialias(arg_t a)
}
}
-cmdreturn_t it_toggle_alpha(arg_t a)
+cmdreturn_t i_toggle_alpha(arg_t a)
{
- img.alpha = tns.alpha = !img.alpha;
- if (mode == MODE_IMAGE)
+ if (mode == MODE_IMAGE) {
+ img.alpha = !img.alpha;
img.dirty = true;
- else
- tns.dirty = true;
- return CMD_DIRTY;
+ return CMD_DIRTY;
+ } else {
+ return CMD_INVALID;
+ }
}
cmdreturn_t i_change_gamma(arg_t a)