summaryrefslogtreecommitdiffstats
path: root/curs_lib.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2015-01-09 14:22:01 -0800
committerKevin McCarthy <kevin@8t8.us>2015-01-09 14:22:01 -0800
commitd4cab506c58db6bf887d5a0735c6b9598f21fe79 (patch)
tree06f0f6a2013293aa8ff966e8a773c7372928bf80 /curs_lib.c
parent0edb1e37a0535647699beb524bd10e1cdfc21df5 (diff)
Add color type for prompts.
This adds a new color type, MT_COLOR_PROMPT, that can be used to colorize prompts (fields, yes/no, multi_choice). Thanks to Ben Boeckel for the patch!
Diffstat (limited to 'curs_lib.c')
-rw-r--r--curs_lib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/curs_lib.c b/curs_lib.c
index 355c899a..23696129 100644
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -139,7 +139,9 @@ int _mutt_get_field (const char *field, char *buf, size_t buflen, int complete,
do
{
CLEARLINE (LINES-1);
+ SETCOLOR (MT_COLOR_PROMPT);
addstr ((char *)field); /* cast to get around bad prototypes */
+ NORMAL_COLOR;
mutt_refresh ();
getyx (stdscr, y, x);
ret = _mutt_enter_string (buf, buflen, y, x, complete, multiple, files, numfiles, es);
@@ -225,8 +227,10 @@ int mutt_yesorno (const char *msg, int def)
answer_string_len = mutt_strwidth (answer_string);
/* maxlen here is sort of arbitrary, so pick a reasonable upper bound */
msglen = mutt_wstr_trunc (msg, 4*COLS, COLS - answer_string_len, NULL);
+ SETCOLOR (MT_COLOR_PROMPT);
addnstr (msg, msglen);
addstr (answer_string);
+ NORMAL_COLOR;
FREE (&answer_string);
FOREVER
@@ -647,7 +651,9 @@ int mutt_multi_choice (char *prompt, char *letters)
int choice;
char *p;
+ SETCOLOR (MT_COLOR_PROMPT);
mvaddstr (LINES - 1, 0, prompt);
+ NORMAL_COLOR;
clrtoeol ();
FOREVER
{