changeset 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
files mcabber/mcabberrc.example mcabber/src/screen.c mcabber/src/screen.h
diffstat 3 files changed, 20 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabberrc.example	Mon Mar 06 11:59:34 2006 +0100
+++ b/mcabber/mcabberrc.example	Mon Mar 06 12:16:23 2006 +0100
@@ -139,6 +139,7 @@
 #
 # background: background color of the chat window and the log window
 # general:    text color in the chat window and the log window
+# highlight:  text color in the chat window for highlighted lines
 # bgstatus:   background color of the status lines
 # status:     text color of the status lines
 # roster:     text color of the roster (buddylist) normal items
@@ -149,6 +150,7 @@
 #
 #set color_background   = blue
 #set color_general      = white
+#set color_highlight    = yellow
 #set color_bgstatus     = blue
 #set color_status       = white
 #set color_roster       = green
--- a/mcabber/src/screen.c	Mon Mar 06 11:59:34 2006 +0100
+++ b/mcabber/src/screen.c	Mon Mar 06 12:16:23 2006 +0100
@@ -127,9 +127,10 @@
 
 static void ParseColors(void)
 {
-  const char *colors[9] = {
+  const char *colors[10] = {
     "", "",
     "general",
+    "highlight",
     "status",
     "roster",
     "rostersel",
@@ -165,6 +166,10 @@
       init_pair(i+1, ((color) ? FindColor(color) : COLOR_WHITE),
                 FindColor(background));
       break;
+    case COLOR_HIGHLIGHT:
+      init_pair(i+1, ((color) ? FindColor(color) : COLOR_YELLOW),
+                FindColor(background));
+      break;
     case COLOR_STATUS:
       init_pair(i+1, ((color) ? FindColor(color) : COLOR_WHITE),
                 FindColor(backstatus));
@@ -388,6 +393,9 @@
     // NOTE: update PREFIX_WIDTH if you change the date format!!
     // You need to set it to the whole prefix length + 1
     if (line) {
+      if (line->flags & HBB_PREFIX_HLIGHT)
+        wattrset(win_entry->win, COLOR_PAIR(COLOR_HIGHLIGHT));
+
       if (line->timestamp) {
         strftime(date, 30, "%m-%d %H:%M", localtime(&line->timestamp));
       } else
@@ -414,11 +422,10 @@
         wprintw(win_entry->win, "%.11s     ", date);
       }
 
-      // Display line
-      if (line->flags & HBB_PREFIX_HLIGHT) wattron(win_entry->win, A_BOLD);
-      wprintw(win_entry->win, "%s", line->text);
-      if (line->flags & HBB_PREFIX_HLIGHT) wattroff(win_entry->win, A_BOLD);
+      wprintw(win_entry->win, "%s", line->text); // Display text line
 
+      if (line->flags & HBB_PREFIX_HLIGHT)
+        wattrset(win_entry->win, COLOR_PAIR(COLOR_GENERAL));
       wclrtoeol(win_entry->win);
       g_free(line->text);
     } else {
--- a/mcabber/src/screen.h	Mon Mar 06 11:59:34 2006 +0100
+++ b/mcabber/src/screen.h	Mon Mar 06 12:16:23 2006 +0100
@@ -7,11 +7,12 @@
 #include "logprint.h"
 
 #define COLOR_GENERAL       3
-#define COLOR_STATUS        4
-#define COLOR_ROSTER        5
-#define COLOR_ROSTERSEL     6
-#define COLOR_ROSTERSELNMSG 7
-#define COLOR_ROSTERNMSG    8
+#define COLOR_HIGHLIGHT     4
+#define COLOR_STATUS        5
+#define COLOR_ROSTER        6
+#define COLOR_ROSTERSEL     7
+#define COLOR_ROSTERSELNMSG 8
+#define COLOR_ROSTERNMSG    9
 
 // Length of the timestamp & flag prefix in the chat buffer window
 #define PREFIX_WIDTH    17