From 88ebb06ba50b4955f88a6e93e8d055a28905308a Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Tue, 3 Dec 2013 18:01:17 -0500 Subject: [PATCH] colour theme changes --- src/chat.c | 4 ++-- src/chat_commands.c | 10 ++++------ src/global_commands.c | 10 ++++------ src/groupchat.c | 18 ++++++++---------- src/misc_tools.c | 6 +++--- src/misc_tools.h | 2 +- 6 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/chat.c b/src/chat.c index 0df5257..7ec1c2f 100644 --- a/src/chat.c +++ b/src/chat.c @@ -33,9 +33,9 @@ static void chat_onMessage(ToxWindow *self, Tox *m, int num, uint8_t *msg, uint1 nick[TOXIC_MAX_NAME_LENGTH] = '\0'; print_time(ctx->history); - wattron(ctx->history, COLOR_PAIR(4)); + wattron(ctx->history, COLOR_PAIR(CYAN)); wprintw(ctx->history, "%s: ", nick); - wattroff(ctx->history, COLOR_PAIR(4)); + wattroff(ctx->history, COLOR_PAIR(CYAN)); if (msg[0] == '>') { wattron(ctx->history, COLOR_PAIR(GREEN)); diff --git a/src/chat_commands.c b/src/chat_commands.c index be8dc0f..17459df 100644 --- a/src/chat_commands.c +++ b/src/chat_commands.c @@ -24,7 +24,7 @@ void cmd_chat_help(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg { wattron(window, COLOR_PAIR(CYAN) | A_BOLD); wprintw(window, "Chat commands:\n"); - wattroff(window, A_BOLD); + wattroff(window, COLOR_PAIR(CYAN) | A_BOLD); wprintw(window, " /status : Set your status with optional note\n"); wprintw(window, " /note : Set a personal note\n"); @@ -40,11 +40,9 @@ void cmd_chat_help(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg wprintw(window, " /quit or /exit : Exit Toxic\n"); wprintw(window, " /help : Print this message again\n"); - wattron(window, A_BOLD); - wprintw(window, "\n * Argument messages must be enclosed in quotation marks.\n"); - wattroff(window, A_BOLD); - - wattroff(window, COLOR_PAIR(CYAN)); + wattron(window, COLOR_PAIR(CYAN) | A_BOLD); + wprintw(window, " * Argument messages must be enclosed in quotation marks.\n\n"); + wattroff(window, COLOR_PAIR(CYAN) | A_BOLD); } void cmd_groupinvite(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) diff --git a/src/global_commands.c b/src/global_commands.c index 33b3d4e..aea0052 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -278,7 +278,7 @@ void cmd_prompt_help(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a wclear(window); wattron(window, COLOR_PAIR(CYAN) | A_BOLD); wprintw(window, "\n\nGlobal commands:\n"); - wattroff(window, A_BOLD); + wattroff(window, COLOR_PAIR(CYAN) | A_BOLD); wprintw(window, " /add : Add friend with optional message\n"); wprintw(window, " /accept : Accept friend request\n"); @@ -292,12 +292,10 @@ void cmd_prompt_help(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a wprintw(window, " /help : Print this message again\n"); wprintw(window, " /clear : Clear the window\n"); - wattron(window, A_BOLD); + wattron(window, COLOR_PAIR(CYAN) | A_BOLD); wprintw(window, " * Argument messages must be enclosed in quotation marks.\n"); - wprintw(window, " * Use TAB and Shift-TAB to navigate through the tabs.\n"); - wattroff(window, A_BOLD); - - wattroff(window, COLOR_PAIR(CYAN)); + wprintw(window, " * Use TAB and Shift-TAB to navigate through the tabs.\n\n"); + wattroff(window, COLOR_PAIR(CYAN) | A_BOLD); } void cmd_quit(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) diff --git a/src/groupchat.c b/src/groupchat.c index 8db52a1..cf9a3b4 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -70,11 +70,11 @@ static void print_groupchat_help(ChatContext *ctx) { wattron(ctx->history, COLOR_PAIR(CYAN) | A_BOLD); wprintw(ctx->history, "Group chat commands:\n"); - wattroff(ctx->history, A_BOLD); + wattroff(ctx->history, COLOR_PAIR(CYAN) | A_BOLD); wprintw(ctx->history, " /add : Add friend with optional message\n"); wprintw(ctx->history, " /status : Set your status with optional note\n"); - wprintw(ctx->history, " /note : Set a personal note\n"); + wprintw(ctx->history, " /note : Set a personal note\n"); wprintw(ctx->history, " /nick : Set your nickname\n"); wprintw(ctx->history, " /groupchat : Create a group chat\n"); wprintw(ctx->history, " /myid : Print your ID\n"); @@ -83,12 +83,10 @@ static void print_groupchat_help(ChatContext *ctx) wprintw(ctx->history, " /quit or /exit : Exit Toxic\n"); wprintw(ctx->history, " /help : Print this message again\n"); - wattron(ctx->history, A_BOLD); - wprintw(ctx->history, "\n * Argument messages must be enclosed in quotation marks.\n"); - wprintw(ctx->history, " * Scroll peer list with the Page Up/Page Down keys.\n"); - wattroff(ctx->history, A_BOLD); - - wattroff(ctx->history, COLOR_PAIR(CYAN)); + wattron(ctx->history, COLOR_PAIR(CYAN) | A_BOLD); + wprintw(ctx->history, " * Argument messages must be enclosed in quotation marks.\n"); + wprintw(ctx->history, " * Scroll peer list with the Page Up/Page Down keys.\n\n"); + wattroff(ctx->history, COLOR_PAIR(CYAN) | A_BOLD); } static void groupchat_onGroupMessage(ToxWindow *self, Tox *m, int groupnum, int peernum, @@ -104,9 +102,9 @@ static void groupchat_onGroupMessage(ToxWindow *self, Tox *m, int groupnum, int nick[TOXIC_MAX_NAME_LENGTH] = '\0'; /* enforce client max name length */ print_time(ctx->history); - wattron(ctx->history, COLOR_PAIR(BLUE)); + wattron(ctx->history, COLOR_PAIR(CYAN)); wprintw(ctx->history, "%s: ", nick); - wattroff(ctx->history, COLOR_PAIR(BLUE)); + wattroff(ctx->history, COLOR_PAIR(CYAN)); if (msg[0] == '>') { wattron(ctx->history, COLOR_PAIR(GREEN)); diff --git a/src/misc_tools.c b/src/misc_tools.c index 0f53053..8f21ab2 100644 --- a/src/misc_tools.c +++ b/src/misc_tools.c @@ -46,9 +46,9 @@ void print_time(WINDOW *window) { struct tm *timeinfo = get_time(); - wattron(window, COLOR_PAIR(CYAN)); + //wattron(window, COLOR_PAIR(CYAN)); wprintw(window, "[%02d:%02d:%02d] ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); - wattroff(window, COLOR_PAIR(CYAN)); + //wattroff(window, COLOR_PAIR(CYAN)); } /* Returns 1 if the string is empty, 0 otherwise */ @@ -197,7 +197,7 @@ void del_char_buf_bck(wchar_t *buf, size_t *pos, size_t *len) --(*len); } -/* Deletes the character after pos */ +/* Deletes the character at pos */ void del_char_buf_frnt(wchar_t *buf, size_t *pos, size_t *len) { if (*pos < 0 || *pos >= *len) diff --git a/src/misc_tools.h b/src/misc_tools.h index 656e927..c4fcd86 100644 --- a/src/misc_tools.h +++ b/src/misc_tools.h @@ -47,7 +47,7 @@ void add_char_to_buf(wchar_t *buf, size_t *pos, size_t *len, wint_t ch); /* Deletes the character before pos */ void del_char_buf_bck(wchar_t *buf, size_t *pos, size_t *len); -/* Deletes the character after pos */ +/* Deletes the character at pos */ void del_char_buf_frnt(wchar_t *buf, size_t *pos, size_t *len); /* nulls buf and sets pos and len to 0 */