* color.c (init_colors) [HAVE_SLANG]: Use "default" instead of

NULL as color names - this works even if COLORFGBG is unset.
Don't check HAS_DIRECT_COLOR_ACCESS - it's now meaningless.
This commit is contained in:
Pavel Roskin 2001-05-29 22:02:16 +00:00
parent d9713d6233
commit 6c24b699cd
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,9 @@
2001-05-29 Pavel Roskin <proski@gnu.org> 2001-05-29 Pavel Roskin <proski@gnu.org>
* color.c (init_colors) [HAVE_SLANG]: Use "default" instead of
NULL as color names - this works even if COLORFGBG is unset.
Don't check HAS_DIRECT_COLOR_ACCESS - it's now meaningless.
* color.h: Define DEFAULT_COLOR_INDEX and DEFAULT_COLOR in the * color.h: Define DEFAULT_COLOR_INDEX and DEFAULT_COLOR in the
same way regardless of HAVE_SLANG. same way regardless of HAVE_SLANG.
* color.c (init_colors) [USE_NCURSES]: Initialize the default * color.c (init_colors) [USE_NCURSES]: Initialize the default

View File

@ -294,7 +294,7 @@ void init_colors (void)
#endif #endif
if (use_colors) { if (use_colors) {
#if defined HAVE_SLANG && !defined(HAS_DIRECT_COLOR_ACCESS) #ifdef HAVE_SLANG
/* /*
* We are relying on undocumented feature of * We are relying on undocumented feature of
* S-Lang to make COLOR_PAIR(DEFAULT_COLOR_INDEX) * S-Lang to make COLOR_PAIR(DEFAULT_COLOR_INDEX)
@ -302,8 +302,8 @@ void init_colors (void)
* Hopefully, future versions of S-Lang will * Hopefully, future versions of S-Lang will
* document this feature. * document this feature.
*/ */
SLtt_set_color (DEFAULT_COLOR_INDEX, NULL, NULL, NULL); SLtt_set_color (DEFAULT_COLOR_INDEX, NULL, "default", "default");
#elif USE_NCURSES #elif defined(USE_NCURSES)
/* Always white on black */ /* Always white on black */
init_pair(DEFAULT_COLOR_INDEX, COLOR_WHITE, COLOR_BLACK); init_pair(DEFAULT_COLOR_INDEX, COLOR_WHITE, COLOR_BLACK);
#endif #endif