menu heading tweaking Take 2
Apparently, color option is meant to apply only to the map, so doesn't
need to appear here, and the reference on the previous commit was wrong.
<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:
@@ -1602,8 +1602,7 @@ void
|
|||||||
adjust_menu_promptstyle(winid window, color_attr *style)
|
adjust_menu_promptstyle(winid window, color_attr *style)
|
||||||
{
|
{
|
||||||
win_request_info wri = zerowri;
|
win_request_info wri = zerowri;
|
||||||
wri.fromcore.menu_promptstyle.color =
|
wri.fromcore.menu_promptstyle.color = style->color;
|
||||||
(iflags.wc_color) ? style->color : NO_COLOR;
|
|
||||||
wri.fromcore.menu_promptstyle.attr = style->attr;
|
wri.fromcore.menu_promptstyle.attr = style->attr;
|
||||||
/* relay the style change to the window port */
|
/* relay the style change to the window port */
|
||||||
(void) ctrl_nhwindow(window, set_menu_promptstyle, &wri);
|
(void) ctrl_nhwindow(window, set_menu_promptstyle, &wri);
|
||||||
@@ -1628,15 +1627,13 @@ add_menu(
|
|||||||
const char *str, /* menu text */
|
const char *str, /* menu text */
|
||||||
unsigned int itemflags) /* itemflags such as MENU_ITEMFLAGS_SELECTED */
|
unsigned int itemflags) /* itemflags such as MENU_ITEMFLAGS_SELECTED */
|
||||||
{
|
{
|
||||||
if (iflags.wc_color && iflags.use_menu_color) {
|
if (iflags.use_menu_color) {
|
||||||
if ((itemflags & MENU_ITEMFLAGS_SKIPMENUCOLORS) == 0)
|
if ((itemflags & MENU_ITEMFLAGS_SKIPMENUCOLORS) == 0)
|
||||||
(void) get_menu_coloring(str, &color, &attr);
|
(void) get_menu_coloring(str, &color, &attr);
|
||||||
}
|
}
|
||||||
/* this is the only function that cared about this flag; remove it now */
|
/* this is the only function that cared about this flag; remove it now */
|
||||||
itemflags &= ~MENU_ITEMFLAGS_SKIPMENUCOLORS;
|
itemflags &= ~MENU_ITEMFLAGS_SKIPMENUCOLORS;
|
||||||
|
|
||||||
if (!iflags.wc_color)
|
|
||||||
color = NO_COLOR;
|
|
||||||
(*windowprocs.win_add_menu)(window, glyphinfo, identifier,
|
(*windowprocs.win_add_menu)(window, glyphinfo, identifier,
|
||||||
ch, gch, attr, color, str, itemflags);
|
ch, gch, attr, color, str, itemflags);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user