From 88e2ee192d0d6021cd381d0f0be36b452d0291fc Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 13 Nov 2023 23:32:38 -0800 Subject: [PATCH] perminv_mode: fix menu coloring The submenu of 'm O' for recently added option 'perminv_mode' didn't have color 0 changed to NO_COLOR. On tty the entries came out blue, on X11 they were nearly invisible. Qt and curses didn't seem to care. I checked all the add_menu() calls in src/*.c and managed to refrain from the impulse to reformat, mostly. --- src/botl.c | 9 ++++----- src/cmd.c | 12 ++++++------ src/options.c | 9 ++++++--- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/botl.c b/src/botl.c index 1d3082517..68ead6db3 100644 --- a/src/botl.c +++ b/src/botl.c @@ -3555,8 +3555,8 @@ status_hilite_menu_choose_updownboth( Sprintf(buf, "Value goes up"); any = cg.zeroany; any.a_int = 10 + GT_VALUE; - add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, ATR_NONE, - clr, buf, MENU_ITEMFLAGS_NONE); + add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, ATR_NONE, clr, + buf, MENU_ITEMFLAGS_NONE); } Sprintf(buf, "Select field %s value:", initblstats[fld].fldname); end_menu(tmpwin, buf); @@ -4076,9 +4076,8 @@ status_hilite_menu_fld(int fld) if (count) { any = cg.zeroany; any.a_int = -1; - add_menu(tmpwin, &nul_glyphinfo, &any, 'X', 0, ATR_NONE, - clr, "Remove selected hilites", - MENU_ITEMFLAGS_NONE); + add_menu(tmpwin, &nul_glyphinfo, &any, 'X', 0, ATR_NONE, clr, + "Remove selected hilites", MENU_ITEMFLAGS_NONE); } #ifndef SCORE_ON_BOTL diff --git a/src/cmd.c b/src/cmd.c index 1618b15e0..fc244e78d 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -3107,15 +3107,15 @@ redo_rebind: any = cg.zeroany; any.a_int = 1; - add_menu(win, &nul_glyphinfo, &any, '\0', 0, ATR_NONE, clr, "bind key to a command", - MENU_ITEMFLAGS_NONE); + add_menu(win, &nul_glyphinfo, &any, '\0', 0, ATR_NONE, clr, + "bind key to a command", MENU_ITEMFLAGS_NONE); any.a_int = 2; - add_menu(win, &nul_glyphinfo, &any, '\0', 0, ATR_NONE, clr, "bind command to a key", - MENU_ITEMFLAGS_NONE); + add_menu(win, &nul_glyphinfo, &any, '\0', 0, ATR_NONE, clr, + "bind command to a key", MENU_ITEMFLAGS_NONE); if (count_bind_keys()) { any.a_int = 3; - add_menu(win, &nul_glyphinfo, &any, '\0', 0, ATR_NONE, clr, "view changed key binds", - MENU_ITEMFLAGS_NONE); + add_menu(win, &nul_glyphinfo, &any, '\0', 0, ATR_NONE, clr, + "view changed key binds", MENU_ITEMFLAGS_NONE); } end_menu(win, "Do what?"); npick = select_menu(win, PICK_ONE, &picks); diff --git a/src/options.c b/src/options.c index e170c9cf6..54f2cf06f 100644 --- a/src/options.c +++ b/src/options.c @@ -423,10 +423,12 @@ ask_do_tutorial(void) any = cg.zeroany; any.a_char = 'y'; add_menu(win, &nul_glyphinfo, &any, any.a_char, 0, - ATR_NONE, NO_COLOR, "Yes, do a tutorial", MENU_ITEMFLAGS_NONE); + ATR_NONE, NO_COLOR, + "Yes, do a tutorial", MENU_ITEMFLAGS_NONE); any.a_char = 'n'; add_menu(win, &nul_glyphinfo, &any, any.a_char, 0, - ATR_NONE, NO_COLOR, "No, just start play", MENU_ITEMFLAGS_NONE); + ATR_NONE, NO_COLOR, + "No, just start play", MENU_ITEMFLAGS_NONE); add_menu_str(win, ""); add_menu_str(win, buf); @@ -5820,7 +5822,8 @@ handler_perminv_mode(void) Sprintf(buf, "%s%s%s", pi0, sepbuf, perminv_modes[i][2]); let = ((i & (int) InvSparse) != 0) ? highc(pi1[0]) : pi0[0]; any.a_int = i + 1; - add_menu(tmpwin, &nul_glyphinfo, &any, let, '0' + i, ATR_NONE, 0, + add_menu(tmpwin, &nul_glyphinfo, &any, let, '0' + i, + ATR_NONE, NO_COLOR, buf, (i == old_pi) ? MENU_ITEMFLAGS_SELECTED : MENU_ITEMFLAGS_NONE); }