nsxiv0566245
Beautified thumbnail marks and selection border
+12 −14
1 file changed
- M thumbs.c +12 −14
| @@ -419,19 +419,19 @@ void tns_mark(tns_t *tns, int n, bool mark) | |||
| 419 | 419 | return; | |
| 420 | 420 | ||
| 421 | 421 | if (n >= 0 && n < tns->cnt) { | |
| 422 | − | unsigned long col; | |
| 423 | − | thumb_t *t = &tns->thumbs[n]; | |
| 424 | 422 | win_t *win = tns->win; | |
| 423 | + | thumb_t *t = &tns->thumbs[n]; | |
| 424 | + | unsigned long col = win->fullscreen ? win->fscol : win->bgcol; | |
| 425 | + | int x = t->x + t->w, y = t->y + t->h; | |
| 426 | + | ||
| 427 | + | win_draw_rect(win, x - 2, y + 1, 1, 2, true, 1, col); | |
| 428 | + | win_draw_rect(win, x + 1, y - 2, 2, 1, true, 1, col); | |
| 425 | 429 | ||
| 426 | 430 | if (mark) | |
| 427 | 431 | col = win->selcol; | |
| 428 | − | else if (win->fullscreen) | |
| 429 | − | col = win->fscol; | |
| 430 | − | else | |
| 431 | − | col = win->bgcol; | |
| 432 | 432 | ||
| 433 | − | win_draw_rect(win, t->x + t->w - 1, t->y + t->h + 1, 6, 2, true, 1, col); | |
| 434 | − | win_draw_rect(win, t->x + t->w + 1, t->y + t->h - 1, 2, 6, true, 1, col); | |
| 433 | + | win_draw_rect(win, x - 1, y + 1, 6, 2, true, 1, col); | |
| 434 | + | win_draw_rect(win, x + 1, y - 1, 2, 6, true, 1, col); | |
| 435 | 435 | ||
| 436 | 436 | if (!mark && n == *tns->sel) | |
| 437 | 437 | tns_highlight(tns, n, true); | |
| @@ -444,20 +444,18 @@ void tns_highlight(tns_t *tns, int n, bool hl) | |||
| 444 | 444 | return; | |
| 445 | 445 | ||
| 446 | 446 | if (n >= 0 && n < tns->cnt) { | |
| 447 | − | unsigned long col; | |
| 448 | − | thumb_t *t = &tns->thumbs[n]; | |
| 449 | 447 | win_t *win = tns->win; | |
| 448 | + | thumb_t *t = &tns->thumbs[n]; | |
| 449 | + | unsigned long col; | |
| 450 | 450 | ||
| 451 | 451 | if (hl) | |
| 452 | 452 | col = win->selcol; | |
| 453 | − | else if (win->fullscreen) | |
| 454 | − | col = win->fscol; | |
| 455 | 453 | else | |
| 456 | − | col = win->bgcol; | |
| 454 | + | col = win->fullscreen ? win->fscol : win->bgcol; | |
| 457 | 455 | ||
| 458 | 456 | win_draw_rect(win, t->x - 2, t->y - 2, t->w + 4, t->h + 4, false, 2, col); | |
| 459 | 457 | ||
| 460 | − | if (!hl && tns->files[n].marked) | |
| 458 | + | if (tns->files[n].marked) | |
| 461 | 459 | tns_mark(tns, n, true); | |
| 462 | 460 | } | |
| 463 | 461 | } | |