fix two minor bugs with colors

1. I used statusbar_color instead of header_color by accident
2. state_line_color has to be explicitely turned off before setting new color
This commit is contained in:
Andrzej Rybczak
2009-09-06 12:55:46 +02:00
parent 56be1cb753
commit 3108fbf0c0
2 changed files with 2 additions and 1 deletions

View File

@@ -241,7 +241,7 @@ int main(int argc, char *argv[])
mvwhline(wHeader->Raw(), 2, 0, 0, COLS); mvwhline(wHeader->Raw(), 2, 0, 0, COLS);
mvwhline(wHeader->Raw(), 4, 0, 0, COLS); mvwhline(wHeader->Raw(), 4, 0, 0, COLS);
*wHeader << XY((COLS-Window::Length(title))/2, 3); *wHeader << XY((COLS-Window::Length(title))/2, 3);
*wHeader << Config.statusbar_color << title << clEnd; *wHeader << Config.header_color << title << clEnd;
*wHeader << clEnd << fmtBoldEnd; *wHeader << clEnd << fmtBoldEnd;
} }
else else

View File

@@ -600,6 +600,7 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
if (!switch_state.empty()) if (!switch_state.empty())
{ {
mvprintw(1, COLS-switch_state.length()-3, "["); mvprintw(1, COLS-switch_state.length()-3, "[");
attroff(COLOR_PAIR(Config.state_line_color));
attron(COLOR_PAIR(Config.state_flags_color)); attron(COLOR_PAIR(Config.state_flags_color));
mvprintw(1, COLS-switch_state.length()-2, "%s", switch_state.c_str()); mvprintw(1, COLS-switch_state.length()-2, "%s", switch_state.c_str());
attroff(COLOR_PAIR(Config.state_flags_color)); attroff(COLOR_PAIR(Config.state_flags_color));