From 5411f625670365b71f38358262c6bc4eeb0a6385 Mon Sep 17 00:00:00 2001 From: Sean Qureshi Date: Wed, 7 Aug 2013 10:36:32 -0700 Subject: [PATCH] Moved main.c to maaster --- main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index 2bf1676..27e3d85 100644 --- a/main.c +++ b/main.c @@ -22,7 +22,7 @@ extern int add_req(uint8_t *public_key); // XXX /* Holds status of chat windows */ char WINDOW_STATUS[MAX_WINDOW_SLOTS]; -#define TOXICVER "0.1.0" //Will be moved to a -D flag later +#define TOXICVER "0.1.0" //Will be moved to a -D flag later static ToxWindow windows[MAX_WINDOW_SLOTS]; static ToxWindow* prompt; @@ -250,6 +250,7 @@ static void load_data(char *path) static void draw_bar() { static int odd = 0; + int blinkrate = 30; attron(COLOR_PAIR(4)); mvhline(LINES - 2, 0, '_', COLS); @@ -258,7 +259,7 @@ static void draw_bar() move(LINES - 1, 0); attron(COLOR_PAIR(4) | A_BOLD); - printw(" TOXIC " TOXICVER " |"); + printw(" TOXIC " TOXICVER " |"); attroff(COLOR_PAIR(4) | A_BOLD); int i; @@ -267,14 +268,13 @@ static void draw_bar() if (i == active_window) attron(A_BOLD); - odd = (odd+1) % 10; - if (windows[i].blink && (odd < 5)) { + odd = (odd+1) % blinkrate; + if (windows[i].blink && (odd < (blinkrate/2))) { attron(COLOR_PAIR(3)); } - printw(" %s", windows[i].title); - if (windows[i].blink && (odd < 5)) { - attron(COLOR_PAIR(3)); + if (windows[i].blink && (odd < (blinkrate/2))) { + attroff(COLOR_PAIR(3)); } if (i == active_window) { attroff(A_BOLD); @@ -376,9 +376,8 @@ int main(int argc, char *argv[]) ch = getch(); if (ch == '\t' || ch == KEY_BTAB) set_active_window(ch); - else if (ch != ERR) { + else if (ch != ERR) a->onKey(a, ch); - } } return 0; }