| @@ -363,6 +363,8 @@ void tns_render(tns_t *tns) |
| 363 | 363 | | |
| 364 | 364 | | imlib_render_image_part_on_drawable_at_size(0, 0, t->w, t->h, |
| 365 | 365 | | t->x, t->y, t->w, t->h); |
| 366 | + | if (t->file->marked) |
| 367 | + | tns_mark(tns, tns->first + i, true); |
| 366 | 368 | | if ((i + 1) % tns->cols == 0) { |
| 367 | 369 | | x = tns->x; |
| 368 | 370 | | y += thumb_dim; |
| @@ -374,20 +376,44 @@ void tns_render(tns_t *tns) |
| 374 | 376 | | tns_highlight(tns, tns->sel, true); |
| 375 | 377 | | } |
| 376 | 378 | | |
| 377 | | − | void tns_highlight(tns_t *tns, int n, bool hl) |
| 379 | + | void tns_mark(tns_t *tns, int n, bool mark) |
| 378 | 380 | | { |
| 379 | | − | thumb_t *t; |
| 380 | | − | win_t *win; |
| 381 | | − | int x, y; |
| 382 | | − | unsigned long col; |
| 383 | | − | |
| 384 | 381 | | if (tns == NULL || tns->thumbs == NULL || tns->win == NULL) |
| 385 | 382 | | return; |
| 386 | 383 | | |
| 387 | | − | win = tns->win; |
| 384 | + | if (n >= 0 && n < tns->cnt) { |
| 385 | + | unsigned long col; |
| 386 | + | thumb_t *t = &tns->thumbs[n]; |
| 387 | + | win_t *win = tns->win; |
| 388 | + | int x = t->x, y = t->y, w = t->w, h = t->h; |
| 389 | + | |
| 390 | + | if (mark || n == tns->sel) |
| 391 | + | col = win->selcol; |
| 392 | + | else if (win->fullscreen) |
| 393 | + | col = win->fscol; |
| 394 | + | else |
| 395 | + | col = win->bgcol; |
| 396 | + | |
| 397 | + | win_draw_rect(win, win->pm, x - 4, y - 4, 8, 2, true, 0, col); |
| 398 | + | win_draw_rect(win, win->pm, x - 4, y - 4, 2, 8, true, 0, col); |
| 399 | + | win_draw_rect(win, win->pm, x + w - 4, y - 4, 8, 2, true, 0, col); |
| 400 | + | win_draw_rect(win, win->pm, x + w + 2, y - 4, 2, 8, true, 0, col); |
| 401 | + | win_draw_rect(win, win->pm, x - 4, y + h + 2, 8, 2, true, 0, col); |
| 402 | + | win_draw_rect(win, win->pm, x - 4, y + h - 4, 2, 8, true, 0, col); |
| 403 | + | win_draw_rect(win, win->pm, x + w - 4, y + h + 2, 8, 2, true, 0, col); |
| 404 | + | win_draw_rect(win, win->pm, x + w + 2, y + h - 4, 2, 8, true, 0, col); |
| 405 | + | } |
| 406 | + | } |
| 407 | + | |
| 408 | + | void tns_highlight(tns_t *tns, int n, bool hl) |
| 409 | + | { |
| 410 | + | if (tns == NULL || tns->thumbs == NULL || tns->win == NULL) |
| 411 | + | return; |
| 388 | 412 | | |
| 389 | 413 | | if (n >= 0 && n < tns->cnt) { |
| 390 | | − | t = &tns->thumbs[n]; |
| 414 | + | unsigned long col; |
| 415 | + | thumb_t *t = &tns->thumbs[n]; |
| 416 | + | win_t *win = tns->win; |
| 391 | 417 | | |
| 392 | 418 | | if (hl) |
| 393 | 419 | | col = win->selcol; |
| @@ -396,10 +422,11 @@ void tns_highlight(tns_t *tns, int n, bool hl) |
| 396 | 422 | | else |
| 397 | 423 | | col = win->bgcol; |
| 398 | 424 | | |
| 399 | | − | x = t->x - (THUMB_SIZE - t->w) / 2; |
| 400 | | − | y = t->y - (THUMB_SIZE - t->h) / 2; |
| 401 | | − | win_draw_rect(win, win->pm, x - 3, y - 3, THUMB_SIZE + 6, THUMB_SIZE + 6, |
| 425 | + | win_draw_rect(win, win->pm, t->x - 3, t->y - 3, t->w + 6, t->h + 6, |
| 402 | 426 | | false, 2, col); |
| 427 | + | |
| 428 | + | if (!hl && t->file->marked) |
| 429 | + | tns_mark(tns, n, true); |
| 403 | 430 | | } |
| 404 | 431 | | } |
| 405 | 432 | | |