curses menu coloring

Have the 'menucolors' option control menu color pattern matching
(instead of curses-specific 'guicolor') for all menus, not just for
the persistent inventory window.
This commit is contained in:
PatR
2019-08-31 23:51:59 -07:00
parent e9aac25922
commit 301a558a9c
6 changed files with 40 additions and 29 deletions
+16
View File
@@ -163,6 +163,22 @@ curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff)
#endif /* TEXTCOLOR */
}
/* call curses_toggle_color_attr() with 'menucolors' instead of 'guicolor'
as the control flag */
void
curses_menu_color_attr(WINDOW *win, int color, int attr, int onoff)
{
boolean save_guicolor = iflags.wc2_guicolor;
/* curses_toggle_color_attr() uses 'guicolor' to decide whether to
honor specified color, but menu windows have their own
more-specific control, 'menucolors', so override with that here */
iflags.wc2_guicolor = iflags.use_menu_color;
curses_toggle_color_attr(win, color, attr, onoff);
iflags.wc2_guicolor = save_guicolor;
}
/* clean up and quit - taken from tty port */