Krolyxon
Commit 25a5a54

Branches

Refs →

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.
Author
NRK
Date
2021-09-17 02:31 +0600
Committer
N-R-K · 2021-09-17 02:32 +0600
Parent
956faac
Commit
25a5a540109cc7b3820daec86bb174b4b96ecb84

+11 −4

5 files changed

  1. M CHANGELOG.md +1 −0
  2. M nsxiv.1 +5 −2
  3. M nsxiv.h +1 −0
  4. M thumbs.c +1 −1
  5. M window.c +3 −1
M CHANGELOG.md View
@@ -18,6 +18,7 @@ nsxiv
1818 * Fill scale mode (#2)
1919 * Configurable X window title (via `config.h` and the `-T` flag) (#23)
2020 * Support custom bar colors via Xresources (#19)
21+ * Support custom mark color via Xresources (#51)
2122 * Toggle animation playback with <kbd>Ctrl-a</kbd> (#33)
2223 * Set `_NET_WM_PID` and `WM_CLIENT_MACHINE` X properties (#13)
2324 * Set `ICCCM WM manager` hints (#12)
M nsxiv.1 View
@@ -402,14 +402,17 @@ Color of the window background
402402 .B window.foreground
403403 Color of the window foreground
404404 .TP
405+.B bar.font
406+Name of Xft bar font
407+.TP
405408 .B bar.background
406409 Color of the bar background. Defaults to window.foreground
407410 .TP
408411 .B bar.foreground
409412 Color of the bar foreground. Defaults to window.background
410413 .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
413416 .TP
414417 Please see xrdb(1) on how to change them.
415418 .SH STATUS BAR
M nsxiv.h View
@@ -421,6 +421,7 @@ struct win {
421421 XftColor win_fg;
422422 XftColor bar_bg;
423423 XftColor bar_fg;
424+ XftColor mrk_fg;
424425
425426 int x;
426427 int y;
M thumbs.c View
@@ -478,7 +478,7 @@ void tns_mark(tns_t *tns, int n, bool mark)
478478 win_draw_rect(win, x + 1, y - 1, tns->bw, 1, true, 1, col);
479479
480480 if (mark)
481− col = win->win_fg.pixel;
481+ col = win->mrk_fg.pixel;
482482
483483 win_draw_rect(win, x, y, tns->bw + 2, tns->bw + 2, true, 1, col);
484484
M window.c View
@@ -94,7 +94,7 @@ const char* win_res(XrmDatabase db, const char *name, const char *def)
9494 void win_init(win_t *win)
9595 {
9696 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;
9898 char *res_man;
9999 XrmDatabase db;
100100 XVisualInfo vis;
@@ -138,10 +138,12 @@ void win_init(win_t *win)
138138 win_fg = win_res(db, RES_CLASS ".window.foreground", "black");
139139 bar_bg = win_res(db, RES_CLASS ".bar.background", win_bg);
140140 bar_fg = win_res(db, RES_CLASS ".bar.foreground", win_fg);
141+ mrk_fg = win_res(db, RES_CLASS ".mark.foreground", win_fg);
141142 win_alloc_color(e, win_bg, &win->win_bg);
142143 win_alloc_color(e, win_fg, &win->win_fg);
143144 win_alloc_color(e, bar_bg, &win->bar_bg);
144145 win_alloc_color(e, bar_fg, &win->bar_fg);
146+ win_alloc_color(e, mrk_fg, &win->mrk_fg);
145147
146148 win->bar.l.size = BAR_L_LEN;
147149 win->bar.r.size = BAR_R_LEN;