From: Miroslav Lichvar Date: Wed, 18 May 2011 17:20:13 +0000 (+0200) Subject: add custom colorsets X-Git-Tag: r0-52-13~10 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b6003b0469f3633470507ed2dd39369db5c0b6e;p=thirdparty%2Fnewt.git add custom colorsets --- diff --git a/newt.c b/newt.c index ab41dd8..8307748 100644 --- a/newt.c +++ b/newt.c @@ -417,7 +417,8 @@ void newtSetColors(struct newtColors colors) { } void newtSetColor(int colorset, char *fg, char *bg) { - if (colorset < NEWT_COLORSET_ROOT || colorset > NEWT_COLORSET_SELLISTBOX || + if (colorset < NEWT_COLORSET_ROOT || + (colorset > NEWT_COLORSET_SELLISTBOX && colorset < NEWT_COLORSET_CUSTOM(0)) || !SLtt_Use_Ansi_Colors) return; diff --git a/newt.h b/newt.h index f71ce1e..81a57ca 100644 --- a/newt.h +++ b/newt.h @@ -31,6 +31,8 @@ extern "C" { #define NEWT_COLORSET_ACTSELLISTBOX 23 #define NEWT_COLORSET_SELLISTBOX 24 +#define NEWT_COLORSET_CUSTOM(x) (1000 + (x)) + #define NEWT_ARG_LAST -100000 #define NEWT_ARG_APPEND -1