mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-25 12:10:03 +00:00
ncurses: call init_pair immediately before using colors
this allows using color0, etc. in ncurses; the nearest available ncurses color will be used
This commit is contained in:
parent
9cc4b083fc
commit
d51bf688ba
@ -761,7 +761,6 @@ struct text_object *construct_text_object(char *s, const char *arg, long line,
|
||||
Colour c = arg != nullptr ? parse_color(arg) : default_color.get(*state);
|
||||
obj->data.l = c.to_argb32();
|
||||
set_current_text_color(c);
|
||||
init_pair(c.to_ncurses(), c.to_ncurses(), COLOR_BLACK);
|
||||
}
|
||||
#endif /* BUILD_NCURSES */
|
||||
obj->callbacks.print = &new_fg;
|
||||
|
@ -81,6 +81,7 @@ bool display_output_ncurses::initialize() {
|
||||
bool display_output_ncurses::shutdown() { return false; }
|
||||
|
||||
void display_output_ncurses::set_foreground_color(Colour c) {
|
||||
init_pair(c.to_ncurses(), c.to_ncurses(), COLOR_BLACK);
|
||||
attron(COLOR_PAIR(c.to_ncurses()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user