comparison mcabber/src/screen.c @ 730:e46c680bdd3d

New color: color_highlight (for outgoing messages)
author Mikael Berthe <mikael@lilotux.net>
date Mon, 06 Mar 2006 12:16:23 +0100
parents 39f67cade02c
children f30031cdb56b
comparison
equal deleted inserted replaced
729:39f67cade02c 730:e46c680bdd3d
125 return -1; 125 return -1;
126 } 126 }
127 127
128 static void ParseColors(void) 128 static void ParseColors(void)
129 { 129 {
130 const char *colors[9] = { 130 const char *colors[10] = {
131 "", "", 131 "", "",
132 "general", 132 "general",
133 "highlight",
133 "status", 134 "status",
134 "roster", 135 "roster",
135 "rostersel", 136 "rostersel",
136 "rosterselmsg", 137 "rosterselmsg",
137 "rosternewmsg", 138 "rosternewmsg",
161 case 2: 162 case 2:
162 init_pair(2, COLOR_WHITE, COLOR_BLACK); 163 init_pair(2, COLOR_WHITE, COLOR_BLACK);
163 break; 164 break;
164 case COLOR_GENERAL: 165 case COLOR_GENERAL:
165 init_pair(i+1, ((color) ? FindColor(color) : COLOR_WHITE), 166 init_pair(i+1, ((color) ? FindColor(color) : COLOR_WHITE),
167 FindColor(background));
168 break;
169 case COLOR_HIGHLIGHT:
170 init_pair(i+1, ((color) ? FindColor(color) : COLOR_YELLOW),
166 FindColor(background)); 171 FindColor(background));
167 break; 172 break;
168 case COLOR_STATUS: 173 case COLOR_STATUS:
169 init_pair(i+1, ((color) ? FindColor(color) : COLOR_WHITE), 174 init_pair(i+1, ((color) ? FindColor(color) : COLOR_WHITE),
170 FindColor(backstatus)); 175 FindColor(backstatus));
386 wmove(win_entry->win, n, 0); 391 wmove(win_entry->win, n, 0);
387 line = *(lines+n); 392 line = *(lines+n);
388 // NOTE: update PREFIX_WIDTH if you change the date format!! 393 // NOTE: update PREFIX_WIDTH if you change the date format!!
389 // You need to set it to the whole prefix length + 1 394 // You need to set it to the whole prefix length + 1
390 if (line) { 395 if (line) {
396 if (line->flags & HBB_PREFIX_HLIGHT)
397 wattrset(win_entry->win, COLOR_PAIR(COLOR_HIGHLIGHT));
398
391 if (line->timestamp) { 399 if (line->timestamp) {
392 strftime(date, 30, "%m-%d %H:%M", localtime(&line->timestamp)); 400 strftime(date, 30, "%m-%d %H:%M", localtime(&line->timestamp));
393 } else 401 } else
394 strcpy(date, " "); 402 strcpy(date, " ");
395 if (line->flags & HBB_PREFIX_INFO) { 403 if (line->flags & HBB_PREFIX_INFO) {
412 wprintw(win_entry->win, "%.11s --> ", date); 420 wprintw(win_entry->win, "%.11s --> ", date);
413 } else { 421 } else {
414 wprintw(win_entry->win, "%.11s ", date); 422 wprintw(win_entry->win, "%.11s ", date);
415 } 423 }
416 424
417 // Display line 425 wprintw(win_entry->win, "%s", line->text); // Display text line
418 if (line->flags & HBB_PREFIX_HLIGHT) wattron(win_entry->win, A_BOLD); 426
419 wprintw(win_entry->win, "%s", line->text); 427 if (line->flags & HBB_PREFIX_HLIGHT)
420 if (line->flags & HBB_PREFIX_HLIGHT) wattroff(win_entry->win, A_BOLD); 428 wattrset(win_entry->win, COLOR_PAIR(COLOR_GENERAL));
421
422 wclrtoeol(win_entry->win); 429 wclrtoeol(win_entry->win);
423 g_free(line->text); 430 g_free(line->text);
424 } else { 431 } else {
425 wclrtobot(win_entry->win); 432 wclrtobot(win_entry->win);
426 break; 433 break;