summaryrefslogtreecommitdiffstats
path: root/thumbs.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-09-04 13:29:17 +0200
committerBert <ber.t@gmx.com>2011-09-04 13:29:17 +0200
commit26eae8be966ab8e7ef940806077b56bbc7c191bc (patch)
tree054ff1f2f46ce23a3d32877db891d9f6448b4ffc /thumbs.c
parentd585b863548737f6e3815e204d4d01b206236ec2 (diff)
downloadnsxiv-26eae8be966ab8e7ef940806077b56bbc7c191bc.tar.zst
Made i(t)_toggle_alpha command work in thumbnail mode too
Diffstat (limited to 'thumbs.c')
-rw-r--r--thumbs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/thumbs.c b/thumbs.c
index 5895c99..5708651 100644
--- a/thumbs.c
+++ b/thumbs.c
@@ -176,6 +176,7 @@ void tns_init(tns_t *tns, int cnt) {
tns->cnt = tns->first = tns->sel = 0;
tns->cap = cnt;
+ tns->alpha = 1;
tns->dirty = 0;
if ((homedir = getenv("HOME"))) {
@@ -335,6 +336,10 @@ void tns_render(tns_t *tns, win_t *win) {
t->x = x + (THUMB_SIZE - t->w) / 2;
t->y = y + (THUMB_SIZE - t->h) / 2;
imlib_context_set_image(t->im);
+
+ if (imlib_image_has_alpha() && !tns->alpha)
+ win_draw_rect(win, win->pm, t->x, t->y, t->w, t->h, True, 0, win->white);
+
imlib_render_image_part_on_drawable_at_size(0, 0, t->w, t->h,
t->x, t->y, t->w, t->h);
if ((i + 1) % tns->cols == 0) {