mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
Using blinking/bright background colors would crash irssi..
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@619 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
2e64899f18
commit
08c6484b6b
@ -222,7 +222,7 @@ static void line_add_colors(GUI_WINDOW_REC *gui, int fg, int bg, int flags)
|
||||
|
||||
/* color should never have last bit on or it would be treated as a
|
||||
command! */
|
||||
color = (fg & 0x0f) | ((bg & 0x0f) << 4);
|
||||
color = (fg & 0x0f) | ((bg & 0x07) << 4);
|
||||
pos = 0;
|
||||
|
||||
if (((fg & ATTR_COLOR8) == 0 && (fg|(bg << 4)) != gui->last_color) ||
|
||||
@ -239,6 +239,10 @@ static void line_add_colors(GUI_WINDOW_REC *gui, int fg, int bg, int flags)
|
||||
buffer[pos++] = 0;
|
||||
buffer[pos++] = LINE_CMD_COLOR8;
|
||||
}
|
||||
if (bg & 0x08) {
|
||||
buffer[pos++] = 0;
|
||||
buffer[pos++] = LINE_CMD_BLINK;
|
||||
}
|
||||
if (flags & PRINTFLAG_INDENT) {
|
||||
buffer[pos++] = 0;
|
||||
buffer[pos++] = LINE_CMD_INDENT;
|
||||
|
@ -80,6 +80,10 @@ static gchar *gui_window_line2text(LINE_REC *line)
|
||||
color &= 0xfff0;
|
||||
color |= 8|ATTR_COLOR8;
|
||||
break;
|
||||
case LINE_CMD_BLINK:
|
||||
color |= 0x80;
|
||||
g_string_sprintfa(str, "\003%c%c", (color & 0x0f)+1, ((color & 0xf0) >> 4)+1);
|
||||
break;
|
||||
case LINE_CMD_INDENT:
|
||||
break;
|
||||
}
|
||||
|
@ -298,6 +298,9 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui, LINE_REC *line
|
||||
color &= 0xfff0;
|
||||
color |= 8|ATTR_COLOR8;
|
||||
break;
|
||||
case LINE_CMD_BLINK:
|
||||
color |= 0x80;
|
||||
break;
|
||||
case LINE_CMD_INDENT:
|
||||
/* set indentation position here - don't do
|
||||
it if we're too close to right border */
|
||||
@ -429,6 +432,9 @@ static void single_line_draw(GUI_WINDOW_REC *gui, int ypos, LINE_CACHE_SUB_REC *
|
||||
color &= 0xfff0;
|
||||
color |= 8|ATTR_COLOR8;
|
||||
break;
|
||||
case LINE_CMD_BLINK:
|
||||
color |= 0x80;
|
||||
break;
|
||||
}
|
||||
set_color(cwin, color);
|
||||
text++;
|
||||
|
@ -19,7 +19,8 @@ enum {
|
||||
LINE_CMD_COLOR0, /* change to black, would be same as \0\0 but it breaks things.. */
|
||||
LINE_CMD_COLOR8, /* change to dark grey, normally 8 = bold black */
|
||||
LINE_CMD_UNDERLINE, /* enable/disable underlining */
|
||||
LINE_CMD_INDENT /* if line is split, indent it at this position */
|
||||
LINE_CMD_INDENT, /* if line is split, indent it at this position */
|
||||
LINE_CMD_BLINK /* blinking background */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
Loading…
Reference in New Issue
Block a user