commit b598590d2dbf0d1b76146745953273eddf6eb126 from: Omar Polo date: Mon Jun 21 21:07:27 2021 UTC allow changing the background color of the body window commit - 50f7147c04445ef8fc489f16ff18f46f90540435 commit + b598590d2dbf0d1b76146745953273eddf6eb126 blob - 41556a907a31f1f5108bf0b97774b4c7c2a66cbb blob + e4044fa58cf2430cf1a51388cd44aad1b9459c0f --- ChangeLog +++ ChangeLog @@ -1,5 +1,7 @@ 2021-06-21 Omar Polo + * telescope.h (enum pairs): allow changing the background color of the body window + * defaults.c (config_setvari): add enable-colors (variable) 2021-06-20 Omar Polo blob - 46b5e8124108c2a3554794750c22cd490f5687d5 blob + d78e6517abf11005a6342c7a5ca976f4aa37c878 --- defaults.c +++ defaults.c @@ -76,6 +76,11 @@ struct tab_face tab_face = { .current_tab = A_NORMAL, }; +struct body_face body_face = { + .bg = 0, + .fg = 0, +}; + struct modeline_face modeline_face = { .background = A_REVERSE, }; @@ -186,6 +191,11 @@ config_setcolor(int bg, const char *name, int prfx, in d->fg = line; d->trail_fg = trail; } + } else if (!strcmp(name, "line")) { + if (bg) + body_face.bg = prfx; + else + body_face.fg = prfx; } else { return 0; } @@ -216,4 +226,7 @@ config_apply_colors(void) f->trail_prop = COLOR_PAIR(d->tp); } } + + init_pair(PBODY, body_face.fg, body_face.bg); + body_face.body = COLOR_PAIR(PBODY); } blob - a75fd076a6ea7e8626f35cf42171a790679918c7 blob + 8657e1ef7c6d1e24194542c4dd5282c498b1b046 --- telescope.h +++ telescope.h @@ -81,6 +81,12 @@ struct tab_face { }; extern struct tab_face tab_face; +struct body_face { + int bg, fg; + int body; +}; +extern struct body_face body_face; + struct modeline_face { int background; }; @@ -326,7 +332,8 @@ extern int body_cols; extern int in_minibuffer; enum pairs { - PT = 1, + PBODY = 1, + PT, PT_PRFX, PT_TRAIL, PL, blob - a323d02b25a6ef46571eaf8ce6a7e01cf9b75e3c blob + 18c979be6d705af4666a27085d2cf6104983ca45 --- ui.c +++ ui.c @@ -1423,6 +1423,7 @@ ui_init(int argc, char * const *argv) body_lines = LINES-3; body_cols = COLS; + wbkgd(body, body_face.body); update_x_offset();