more menu header tweaking re options

<color>
off: map, menu items, menu headings, menu prompt/title all, everything should have color suppressed.

<curses guicolor>
on: map, menu items, menu headings, menu prompt/title can all feature color, as can
menu borders, menu-selector letters.
off: map, menu headings, menu prompt and menu items (menucolors on) can still feature color,
but all other non-map features such as menu borders, menu-selector
letters will not have color.

<menucolors>
on: menu items can have colors if they match one of the regex in config
file; menu headings, menu prompt can also be in color (based on menu_headings option).
off: menu items won't have colors, but menu headings, menu prompt still
will feature colors (based on menu_headings option); those are not impacted by turning
off menucolors.
This commit is contained in:
nhmall
2023-11-16 13:41:07 -05:00
parent 7beef848c4
commit bb10f9a5d0
6 changed files with 19 additions and 5 deletions

View File

@@ -1209,10 +1209,10 @@ menu_display_page(
for (count = 0; count < num_lines; count++) {
tmpstr = curses_break_str(menu->prompt, menu->width, count + 1);
curses_toggle_color_attr(win, curses_menu_promptstyle.color,
curses_menu_color_attr(win, curses_menu_promptstyle.color,
curses_menu_promptstyle.attr, ON);
mvwprintw(win, count + 1, 1, "%s", tmpstr);
curses_toggle_color_attr(win, curses_menu_promptstyle.color,
curses_menu_color_attr(win, curses_menu_promptstyle.color,
curses_menu_promptstyle.attr, OFF);
free(tmpstr);
}

View File

@@ -169,7 +169,8 @@ curses_menu_color_attr(WINDOW *win, int color, int attr, int onoff)
/* 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;
/* iflags.wc2_guicolor = iflags.use_menu_color; */
iflags.wc2_guicolor = (color != NONE);
curses_toggle_color_attr(win, color, attr, onoff);
iflags.wc2_guicolor = save_guicolor;
}