diff options
author | Timo Sirainen <cras@irssi.org> | 2001-11-04 21:47:37 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-11-04 21:47:37 +0000 |
commit | d589ac85ce5d4aa17f092793c819a55db7833579 (patch) | |
tree | 8d58049433c97a6ec54230dc30409576f61c5bfa /src/fe-text/textbuffer-view.c | |
parent | 5397b33d2d337d0166d6d138857ed5f7a8e331d5 (diff) | |
download | irssi-d589ac85ce5d4aa17f092793c819a55db7833579.zip |
Still messing up with colors.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1972 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/textbuffer-view.c')
-rw-r--r-- | src/fe-text/textbuffer-view.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index bc557129..35522ad5 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -101,30 +101,28 @@ static void textbuffer_cache_unref(TEXT_BUFFER_CACHE_REC *cache) textbuffer_cache_destroy(cache); } -#define FGATTR (ATTR_NOCOLORS | ATTR_RESETBG | ATTR_BLINK | 0xf0) -#define BGATTR (ATTR_NOCOLORS | ATTR_RESETFG | ATTR_BOLD | 0x0f) +#define FGATTR (ATTR_NOCOLORS | ATTR_RESETFG | ATTR_BOLD | 0x0f) +#define BGATTR (ATTR_NOCOLORS | ATTR_RESETBG | ATTR_BLINK | 0xf0) static void update_cmd_color(unsigned char cmd, int *color) { if ((cmd & 0x80) == 0) { if (cmd & LINE_COLOR_BG) { /* set background color */ - *color &= BGATTR; - if ((cmd & LINE_COLOR_DEFAULT) == 0) { - *color &= 0x70; + *color &= FGATTR; + if ((cmd & LINE_COLOR_DEFAULT) == 0) *color |= (cmd & 0x0f) << 4; - } else { + else { *color |= ATTR_RESETBG; if (cmd & LINE_COLOR_BLINK) *color |= ATTR_BLINK; } } else { /* set foreground color */ - *color &= FGATTR; - if ((cmd & LINE_COLOR_DEFAULT) == 0) { - *color &= 0x0f; + *color &= BGATTR; + if ((cmd & LINE_COLOR_DEFAULT) == 0) *color |= cmd & 0x0f; - } else { + else { *color |= ATTR_RESETFG; if (cmd & LINE_COLOR_BOLD) *color |= ATTR_BOLD; |