]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
add custom colorsets
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 18 May 2011 17:20:13 +0000 (19:20 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 18 May 2011 17:20:13 +0000 (19:20 +0200)
newt.c
newt.h

diff --git a/newt.c b/newt.c
index ab41dd80a5a4e5efabb95c2ddc983f2116dfb635..83077480d36e4e2914a1c8458dfcd12d3650905b 100644 (file)
--- 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 f71ce1e8fcd8fcb226275dc2a695fcbf8bb793d5..81a57ca251c2f574254ca3097af7508ca450114a 100644 (file)
--- 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