nsxiv25a5a54
add .mark.foreground to Xresources
since we're already allowing both window and bar colors to be customizable, it doesn't make sense to not allow so for mark color.
+11 −4
5 files changed
- M CHANGELOG.md +1 −0
- M nsxiv.1 +5 −2
- M nsxiv.h +1 −0
- M thumbs.c +1 −1
- M window.c +3 −1
| @@ -18,6 +18,7 @@ nsxiv | |||
| 18 | 18 | * Fill scale mode (#2) | |
| 19 | 19 | * Configurable X window title (via `config.h` and the `-T` flag) (#23) | |
| 20 | 20 | * Support custom bar colors via Xresources (#19) | |
| 21 | + | * Support custom mark color via Xresources (#51) | |
| 21 | 22 | * Toggle animation playback with <kbd>Ctrl-a</kbd> (#33) | |
| 22 | 23 | * Set `_NET_WM_PID` and `WM_CLIENT_MACHINE` X properties (#13) | |
| 23 | 24 | * Set `ICCCM WM manager` hints (#12) | |
| @@ -402,14 +402,17 @@ Color of the window background | |||
| 402 | 402 | .B window.foreground | |
| 403 | 403 | Color of the window foreground | |
| 404 | 404 | .TP | |
| 405 | + | .B bar.font | |
| 406 | + | Name of Xft bar font | |
| 407 | + | .TP | |
| 405 | 408 | .B bar.background | |
| 406 | 409 | Color of the bar background. Defaults to window.foreground | |
| 407 | 410 | .TP | |
| 408 | 411 | .B bar.foreground | |
| 409 | 412 | Color of the bar foreground. Defaults to window.background | |
| 410 | 413 | .TP | |
| 411 | − | .B bar.font | |
| 412 | − | Name of Xft bar font | |
| 414 | + | .B mark.foreground | |
| 415 | + | Color of the mark foreground. Defaults to window.foreground | |
| 413 | 416 | .TP | |
| 414 | 417 | Please see xrdb(1) on how to change them. | |
| 415 | 418 | .SH STATUS BAR | |
| @@ -421,6 +421,7 @@ struct win { | |||
| 421 | 421 | XftColor win_fg; | |
| 422 | 422 | XftColor bar_bg; | |
| 423 | 423 | XftColor bar_fg; | |
| 424 | + | XftColor mrk_fg; | |
| 424 | 425 | ||
| 425 | 426 | int x; | |
| 426 | 427 | int y; | |
| @@ -478,7 +478,7 @@ void tns_mark(tns_t *tns, int n, bool mark) | |||
| 478 | 478 | win_draw_rect(win, x + 1, y - 1, tns->bw, 1, true, 1, col); | |
| 479 | 479 | ||
| 480 | 480 | if (mark) | |
| 481 | − | col = win->win_fg.pixel; | |
| 481 | + | col = win->mrk_fg.pixel; | |
| 482 | 482 | ||
| 483 | 483 | win_draw_rect(win, x, y, tns->bw + 2, tns->bw + 2, true, 1, col); | |
| 484 | 484 | ||
| @@ -94,7 +94,7 @@ const char* win_res(XrmDatabase db, const char *name, const char *def) | |||
| 94 | 94 | void win_init(win_t *win) | |
| 95 | 95 | { | |
| 96 | 96 | win_env_t *e; | |
| 97 | − | const char *win_bg, *win_fg, *bar_bg, *bar_fg, *f; | |
| 97 | + | const char *win_bg, *win_fg, *bar_bg, *bar_fg, *mrk_fg, *f; | |
| 98 | 98 | char *res_man; | |
| 99 | 99 | XrmDatabase db; | |
| 100 | 100 | XVisualInfo vis; | |
| @@ -138,10 +138,12 @@ void win_init(win_t *win) | |||
| 138 | 138 | win_fg = win_res(db, RES_CLASS ".window.foreground", "black"); | |
| 139 | 139 | bar_bg = win_res(db, RES_CLASS ".bar.background", win_bg); | |
| 140 | 140 | bar_fg = win_res(db, RES_CLASS ".bar.foreground", win_fg); | |
| 141 | + | mrk_fg = win_res(db, RES_CLASS ".mark.foreground", win_fg); | |
| 141 | 142 | win_alloc_color(e, win_bg, &win->win_bg); | |
| 142 | 143 | win_alloc_color(e, win_fg, &win->win_fg); | |
| 143 | 144 | win_alloc_color(e, bar_bg, &win->bar_bg); | |
| 144 | 145 | win_alloc_color(e, bar_fg, &win->bar_fg); | |
| 146 | + | win_alloc_color(e, mrk_fg, &win->mrk_fg); | |
| 145 | 147 | ||
| 146 | 148 | win->bar.l.size = BAR_L_LEN; | |
| 147 | 149 | win->bar.r.size = BAR_R_LEN; | |