* color.c (mc_init_pair) [HAVE_SLANG]: Pass "default", not NULL

to SLtt_set_color() - it fixes transparency with the latest
versions of S-Lang.  Treat foreground like background.
This commit is contained in:
Pavel Roskin 2002-11-28 18:57:05 +00:00
parent 759125c6c7
commit 8ba045461d
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2002-11-28 Pavel Roskin <proski@gnu.org>
* color.c (mc_init_pair) [HAVE_SLANG]: Pass "default", not NULL
to SLtt_set_color() - it fixes transparency with the latest
versions of S-Lang. Treat foreground like background.
2002-11-20 Pavel Roskin <proski@gnu.org>
* main.c: Eliminate finish_program variable - mc can now exit

View File

@ -121,7 +121,7 @@ static struct color_table_s const color_table [] = {
{ "brightcyan", COLOR_CYAN | A_BOLD },
{ "lightgray", COLOR_WHITE },
{ "white", COLOR_WHITE | A_BOLD },
{ "default", 0 } /* hack for transparent background */
{ "default", 0 } /* default color of the terminal */
};
#ifdef HAVE_SLANG
@ -321,10 +321,11 @@ static struct colors_avail {
void
mc_init_pair (int index, CTYPE foreground, CTYPE background)
{
/* hack for transparent background for Eterm, rxvt or else */
if (background && !strcmp (background, "default"))
background = NULL;
/* if foreground is default, I guess we should use normal fore-color. */
if (!background)
background = "default";
if (!foreground)
foreground = "default";
SLtt_set_color (index, "", foreground, background);
if (index > max_index)