changeset 723:23068490d063

Add text color when the selected buddy has an unread message (Only when chat mode is disabled, of course.)
author Mikael Berthe <mikael@lilotux.net>
date Sun, 05 Mar 2006 11:00:24 +0100
parents 9054697b1a06
children 264375fe7159
files mcabber/mcabberrc.example mcabber/src/screen.c mcabber/src/screen.h
diffstat 3 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabberrc.example	Sun Mar 05 10:43:36 2006 +0100
+++ b/mcabber/mcabberrc.example	Sun Mar 05 11:00:24 2006 +0100
@@ -144,6 +144,7 @@
 # roster:     text color of the roster (buddylist) normal items
 # bgrostersel: background color of the selected roster item
 # rostersel:   text color of the selected roster item
+# rosterselmsg:text color of the selected roster item, if there is a new msg
 # rosternewmsg: text color of items with unread messages
 #
 #set color_background   = blue
@@ -153,6 +154,7 @@
 #set color_roster       = green
 #set color_bgrostersel  = cyan
 #set color_rostersel    = blue
+#set color_rosterselmsg = red
 #set color_rosternewmsg = red
 
 # Style
--- a/mcabber/src/screen.c	Sun Mar 05 10:43:36 2006 +0100
+++ b/mcabber/src/screen.c	Sun Mar 05 11:00:24 2006 +0100
@@ -127,12 +127,13 @@
 
 static void ParseColors(void)
 {
-  const char *colors[8] = {
+  const char *colors[9] = {
     "", "",
     "general",
     "status",
     "roster",
     "rostersel",
+    "rosterselmsg",
     "rosternewmsg",
     NULL
   };
@@ -176,6 +177,10 @@
       init_pair(i+1, ((color) ? FindColor(color) : COLOR_BLUE),
                 FindColor(backselected));
       break;
+    case COLOR_ROSTERSELNMSG:
+      init_pair(i+1, ((color) ? FindColor(color) : COLOR_RED),
+                FindColor(backselected));
+      break;
     case COLOR_ROSTERNMSG:
       init_pair(i+1, ((color) ? FindColor(color) : COLOR_RED),
                 FindColor(background));
@@ -897,8 +902,11 @@
         status = imstatus2char[budstate];
     }
     if (buddy == current_buddy) {
-      wattrset(rosterWnd, COLOR_PAIR(COLOR_ROSTERSEL));
-      // The 3 following lines aim to color the whole line
+      if (pending == '#')
+        wattrset(rosterWnd, COLOR_PAIR(COLOR_ROSTERSELNMSG));
+      else
+        wattrset(rosterWnd, COLOR_PAIR(COLOR_ROSTERSEL));
+      // The 3 following lines aim at coloring the whole line
       wmove(rosterWnd, i, 0);
       for (n = 0; n < maxx; n++)
         waddch(rosterWnd, ' ');
--- a/mcabber/src/screen.h	Sun Mar 05 10:43:36 2006 +0100
+++ b/mcabber/src/screen.h	Sun Mar 05 11:00:24 2006 +0100
@@ -6,11 +6,12 @@
 
 #include "logprint.h"
 
-#define COLOR_GENERAL    3
-#define COLOR_STATUS     4
-#define COLOR_ROSTER     5
-#define COLOR_ROSTERSEL  6
-#define COLOR_ROSTERNMSG 7
+#define COLOR_GENERAL       3
+#define COLOR_STATUS        4
+#define COLOR_ROSTER        5
+#define COLOR_ROSTERSEL     6
+#define COLOR_ROSTERSELNMSG 7
+#define COLOR_ROSTERNMSG    8
 
 // Length of the timestamp & flag prefix in the chat buffer window
 #define PREFIX_WIDTH    17