commit cb6c7aa0f2181e8fe3b60efd66c440288967c642 from: Omar Polo date: Tue Mar 16 18:24:10 2021 UTC move tabline style to an external struct commit - 318400264718f49d7b20ea385927a7ef1216bb78 commit + cb6c7aa0f2181e8fe3b60efd66c440288967c642 blob - 1c4e87da96fbee35ff347ba33fe0c0f290d1dbb8 blob + 2625844595554b41afae0707bdeb684270465a40 --- ui.c +++ ui.c @@ -202,6 +202,12 @@ static struct line_face { [LINE_PRE_START] = { 0 }, [LINE_PRE_CONTENT] = { 0 }, [LINE_PRE_END] = { 0 }, +}; + +static struct tab_face { + int background, tab, current_tab; +} tab_face = { + A_REVERSE, A_REVERSE, A_NORMAL }; static void @@ -1162,8 +1168,9 @@ redraw_tabline(void) toskip--; werase(tabline); - wattron(tabline, A_REVERSE); + wattron(tabline, tab_face.background); wprintw(tabline, toskip == 0 ? " " : "<"); + wattroff(tabline, tab_face.background); truncated = 0; TAILQ_FOREACH(tab, &tabshead, tabs) { @@ -1194,17 +1201,21 @@ redraw_tabline(void) } if (current) - wattroff(tabline, A_REVERSE); + wattron(tabline, tab_face.current_tab); + else + wattron(tabline, tab_face.tab); wprintw(tabline, "%s", buf); - - if (current) - wattron(tabline, A_REVERSE); - if (TAILQ_NEXT(tab, tabs) != NULL) wprintw(tabline, " "); + + if (current) + wattroff(tabline, tab_face.current_tab); + else + wattroff(tabline, tab_face.tab); } + wattron(tabline, tab_face.background); for (; x < COLS; ++x) waddch(tabline, ' '); if (truncated)