about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-02-18 21:46:29 +0000
committerJames Booth <boothj5@gmail.com>2012-02-18 21:46:29 +0000
commit809daa9395a0475ac0ffa8bf65c99aa2a28d752c (patch)
treedd8edac9d1043abb33916264dfc428d2c08e673e
parent2e62950f336a61dfe30304907ae620a2045f5c01 (diff)
downloadprofani-tty-809daa9395a0475ac0ffa8bf65c99aa2a28d752c.tar.gz
More UI tweaks
-rw-r--r--windows.c64
1 files changed, 59 insertions, 5 deletions
diff --git a/windows.c b/windows.c
index ac85fd59..af5f5f88 100644
--- a/windows.c
+++ b/windows.c
@@ -23,6 +23,7 @@ void gui_init(void)
         init_pair(2, COLOR_GREEN, COLOR_BLACK);
         init_pair(3, COLOR_WHITE, COLOR_BLUE);
         init_pair(4, COLOR_CYAN, COLOR_BLUE);
+        init_pair(5, COLOR_CYAN, COLOR_BLACK);
     }
 
     refresh();
@@ -94,16 +95,42 @@ void win_show_incomming_msg(char *from, char *message)
     char from_cpy[100];
     strcpy(from_cpy, from);
     
-    char line[100];
     char *short_from = strtok(from_cpy, "/");
     char tstmp[80];
     get_time(tstmp);
 
-    sprintf(line, " [%s] <%s> %s\n", tstmp, short_from, message);
-
     int win = _find_win(short_from);
 
-    wprintw(_wins[win].win, line);
+    // print time   
+    wattron(_wins[win].win, COLOR_PAIR(5));
+    wprintw(_wins[win].win, " [");
+    wattroff(_wins[win].win, COLOR_PAIR(5));
+
+    wprintw(_wins[win].win, "%s", tstmp);
+
+    wattron(_wins[win].win, COLOR_PAIR(5));
+    wprintw(_wins[win].win, "] ");
+    wattroff(_wins[win].win, COLOR_PAIR(5));
+    
+    // print user
+    wattron(_wins[win].win, A_DIM);
+    wprintw(_wins[win].win, "<");
+    wattroff(_wins[win].win, A_DIM);
+
+    wattron(_wins[win].win, COLOR_PAIR(2));
+    wattron(_wins[win].win, A_BOLD);
+    wprintw(_wins[win].win, "%s", short_from);
+    wattroff(_wins[win].win, COLOR_PAIR(2));
+    wattroff(_wins[win].win, A_BOLD);
+
+    wattron(_wins[win].win, A_DIM);
+    wprintw(_wins[win].win, "> ");
+    wattroff(_wins[win].win, A_DIM);
+
+    // print message
+    wprintw(_wins[win].win, "%s\n", message);
+
+    // update window
     status_bar_active(win);
 }
 
@@ -117,7 +144,34 @@ void win_show_outgoing_msg(char *from, char *to, char *message)
 
     int win = _find_win(to);
 
-    wprintw(_wins[win].win, line);
+    // print time   
+    wattron(_wins[win].win, COLOR_PAIR(5));
+    wprintw(_wins[win].win, " [");
+    wattroff(_wins[win].win, COLOR_PAIR(5));
+
+    wprintw(_wins[win].win, "%s", tstmp);
+
+    wattron(_wins[win].win, COLOR_PAIR(5));
+    wprintw(_wins[win].win, "] ");
+    wattroff(_wins[win].win, COLOR_PAIR(5));
+
+    // print user
+    wattron(_wins[win].win, A_DIM);
+    wprintw(_wins[win].win, "<");
+    wattroff(_wins[win].win, A_DIM);
+
+    wattron(_wins[win].win, A_BOLD);
+    wprintw(_wins[win].win, "%s", from);
+    wattroff(_wins[win].win, A_BOLD);
+
+    wattron(_wins[win].win, A_DIM);
+    wprintw(_wins[win].win, "> ");
+    wattroff(_wins[win].win, A_DIM);
+
+    // print message
+    wprintw(_wins[win].win, "%s\n", message);
+
+    // update window
     status_bar_active(win);
 }