Krolyxon
Commit 0566245

Branches

Refs →

nsxiv0566245

Beautified thumbnail marks and selection border

Author
Bert Münnich
Date
2014-08-18 15:42 +0200
Parent
fe3a1e3
Commit
056624548ae1baa4eec3ce634469349de18b0705

+12 −14

1 file changed

  1. M thumbs.c +12 −14
M thumbs.c View
@@ -419,19 +419,19 @@ void tns_mark(tns_t *tns, int n, bool mark)
419419 return;
420420
421421 if (n >= 0 && n < tns->cnt) {
422− unsigned long col;
423− thumb_t *t = &tns->thumbs[n];
424422 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);
425429
426430 if (mark)
427431 col = win->selcol;
428− else if (win->fullscreen)
429− col = win->fscol;
430− else
431− col = win->bgcol;
432432
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);
435435
436436 if (!mark && n == *tns->sel)
437437 tns_highlight(tns, n, true);
@@ -444,20 +444,18 @@ void tns_highlight(tns_t *tns, int n, bool hl)
444444 return;
445445
446446 if (n >= 0 && n < tns->cnt) {
447− unsigned long col;
448− thumb_t *t = &tns->thumbs[n];
449447 win_t *win = tns->win;
448+ thumb_t *t = &tns->thumbs[n];
449+ unsigned long col;
450450
451451 if (hl)
452452 col = win->selcol;
453− else if (win->fullscreen)
454− col = win->fscol;
455453 else
456− col = win->bgcol;
454+ col = win->fullscreen ? win->fscol : win->bgcol;
457455
458456 win_draw_rect(win, t->x - 2, t->y - 2, t->w + 4, t->h + 4, false, 2, col);
459457
460− if (!hl && tns->files[n].marked)
458+ if (tns->files[n].marked)
461459 tns_mark(tns, n, true);
462460 }
463461 }