Change menu_headings to accept color and attribute
Instead of just accepting an attribute, it's now possible to use a color, or both color and attribute, for example: OPTIONS=menu_headings:inverse OPTIONS=menu_headings:red OPTIONS=menu_headings:red&underline Default is still just inverse. This lets the player change the menu heading color without needing to use menu colors for them. Also makes it so the core uses NO_COLOR instead of 0, for all the menu lines which don't have any prefedefined color. Tested for tty, curses, x11, qt, and win32
This commit is contained in:
@@ -794,7 +794,7 @@ X11_add_menu(winid window,
|
||||
char ch, /* selector letter; 0 if not selectable */
|
||||
char gch, /* group accelerator (0 = no group) */
|
||||
int attr,
|
||||
int clr UNUSED,
|
||||
int clr,
|
||||
const char *str,
|
||||
unsigned itemflags)
|
||||
{
|
||||
@@ -813,6 +813,7 @@ X11_add_menu(winid window,
|
||||
item->next = (x11_menu_item *) 0;
|
||||
item->identifier = *identifier;
|
||||
item->attr = attr;
|
||||
item->color = clr;
|
||||
item->itemflags = itemflags;
|
||||
item->selected = item->preselected = preselected;
|
||||
item->pick_count = -1L;
|
||||
@@ -1314,8 +1315,10 @@ menu_create_entries(struct xwindow *wp, struct menu *curr_menu)
|
||||
XtSetArg(args[num_args], nhStr(XtNvertDistance), 0); num_args++;
|
||||
|
||||
if (!iflags.use_menu_color || wp->menu_information->disable_mcolors
|
||||
|| !get_menu_coloring(curr->str, &color, &attr))
|
||||
|| !get_menu_coloring(curr->str, &color, &attr)) {
|
||||
attr = curr->attr;
|
||||
color = curr->color;
|
||||
}
|
||||
|
||||
if (color != NO_COLOR) {
|
||||
if (attr != ATR_INVERSE)
|
||||
|
||||
Reference in New Issue
Block a user