commit d5493194c967ba9fff329ee44c4c7ea3ed1f541a from: Omar Polo date: Tue Jun 15 19:37:52 2021 UTC move all styling to defaults.c i.e. don't hardcode text attributes commit - 8dc60352fb6004d15c7f04a3e192148e485d9d37 commit + d5493194c967ba9fff329ee44c4c7ea3ed1f541a blob - 9a41787c14a903f5aa7e05ad2cefdc6f6d49d29d blob + 4d720585e680b3e6ce97f96636205948425f74db --- defaults.c +++ defaults.c @@ -49,3 +49,11 @@ struct tab_face tab_face = { .tab = A_REVERSE, .current_tab = A_NORMAL, }; + +struct modeline_face modeline_face = { + .background = A_REVERSE, +}; + +struct minibuffer_face minibuffer_face = { + .background = A_NORMAL, +}; blob - 79ffd87c9f908fdb8f872f699c8e8c728571ebfc blob + 6ad2d80640e8219d0bc964512d68a2d47ce5d811 --- telescope.h +++ telescope.h @@ -74,6 +74,16 @@ struct tab_face { int background, tab, current_tab; }; extern struct tab_face tab_face; + +struct modeline_face { + int background; +}; +extern struct modeline_face modeline_face; + +struct minibuffer_face { + int background; +}; +extern struct minibuffer_face minibuffer_face; enum line_type { LINE_TEXT, blob - 856e0a01b9cbe04a8337b3a66c34759c575470e2 blob + cbe49de416bf3b27674c948cf1ad74fcd94a4c74 --- ui.c +++ ui.c @@ -1543,7 +1543,7 @@ redraw_modeline(struct tab *tab) const char *spin = "-\\|/"; werase(modeline); - wattron(modeline, A_REVERSE); + wattron(modeline, modeline_face.background); wmove(modeline, 0, 0); wprintw(modeline, "-%c%c %s ", @@ -1575,6 +1575,8 @@ redraw_modeline(struct tab *tab) for (; x < max_x; ++x) waddstr(modeline, "-"); + + wattroff(modeline, modeline_face.background); } static void @@ -1584,6 +1586,7 @@ redraw_minibuffer(void) size_t off_y, off_x = 0; char *start, *c; + wattron(minibuf, minibuffer_face.background); werase(minibuf); if (in_minibuffer) { @@ -1624,6 +1627,8 @@ redraw_minibuffer(void) if (in_minibuffer) wmove(minibuf, 0, off_x + utf8_swidth_between(start, c)); + + wattroff(minibuf, minibuffer_face.background); } static void