diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-07-22 08:11:39 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-07-22 08:11:39 +0000 |
commit | 3d724fb6344d985929c8d8eda6f0035df5f833af (patch) | |
tree | fad29d80dc3717d750f6f84603e68ba5ca9c97d2 /src | |
parent | 29d0225e4a5b3f9713aa73ae8ec24518ebadca70 (diff) | |
download | weechat-3d724fb6344d985929c8d8eda6f0035df5f833af.zip |
Join and part/quit prefixes (arrows) now displayed with different colors
Diffstat (limited to 'src')
-rw-r--r-- | src/common/weeconfig.c | 10 | ||||
-rw-r--r-- | src/common/weeconfig.h | 2 | ||||
-rw-r--r-- | src/gui/curses/gui-display.c | 6 | ||||
-rw-r--r-- | src/gui/gui.h | 80 | ||||
-rw-r--r-- | src/irc/irc-display.c | 9 |
5 files changed, 67 insertions, 40 deletions
diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c index 6ca137449..d924fc436 100644 --- a/src/common/weeconfig.c +++ b/src/common/weeconfig.c @@ -194,6 +194,8 @@ int cfg_col_chat_time; int cfg_col_chat_time_sep; int cfg_col_chat_prefix1; int cfg_col_chat_prefix2; +int cfg_col_chat_join; +int cfg_col_chat_part; int cfg_col_chat_nick; int cfg_col_chat_host; int cfg_col_chat_channel; @@ -268,6 +270,14 @@ t_config_option weechat_options_colors[] = N_("color for middle char of prefix"), OPTION_TYPE_COLOR, 0, 0, 0, "white", NULL, &cfg_col_chat_prefix2, NULL, &config_change_color }, + { "col_chat_join", N_("color for join arrow (prefix)"), + N_("color for join arrow (prefix)"), + OPTION_TYPE_COLOR, 0, 0, 0, + "lightgreen", NULL, &cfg_col_chat_join, NULL, &config_change_color }, + { "col_chat_part", N_("color for part/quit arrow (prefix)"), + N_("color for part/quit arrow (prefix)"), + OPTION_TYPE_COLOR, 0, 0, 0, + "lightred", NULL, &cfg_col_chat_part, NULL, &config_change_color }, { "col_chat_nick", N_("color for nicks in actions"), N_("color for nicks in actions (chat window)"), OPTION_TYPE_COLOR, 0, 0, 0, diff --git a/src/common/weeconfig.h b/src/common/weeconfig.h index 18e4768b5..b760a8857 100644 --- a/src/common/weeconfig.h +++ b/src/common/weeconfig.h @@ -108,6 +108,8 @@ extern int cfg_col_chat_time; extern int cfg_col_chat_time_sep; extern int cfg_col_chat_prefix1; extern int cfg_col_chat_prefix2; +extern int cfg_col_chat_join; +extern int cfg_col_chat_part; extern int cfg_col_chat_nick; extern int cfg_col_chat_host; extern int cfg_col_chat_channel; diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index b970c3071..6f77de572 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -2241,6 +2241,10 @@ gui_init_colors () cfg_col_chat_prefix1, cfg_col_chat_bg); init_pair (COLOR_WIN_CHAT_PREFIX2, cfg_col_chat_prefix2, cfg_col_chat_bg); + init_pair (COLOR_WIN_CHAT_JOIN, + cfg_col_chat_join, cfg_col_chat_bg); + init_pair (COLOR_WIN_CHAT_PART, + cfg_col_chat_part, cfg_col_chat_bg); init_pair (COLOR_WIN_CHAT_NICK, cfg_col_chat_nick, cfg_col_chat_bg); init_pair (COLOR_WIN_CHAT_HOST, @@ -2329,6 +2333,8 @@ gui_init_colors () color_attr[COLOR_WIN_CHAT_DARK - 1] = (cfg_col_chat_dark >= 0) ? cfg_col_chat_dark & A_BOLD : 0; color_attr[COLOR_WIN_CHAT_PREFIX1 - 1] = (cfg_col_chat_prefix1 >= 0) ? cfg_col_chat_prefix1 & A_BOLD : 0; color_attr[COLOR_WIN_CHAT_PREFIX2 - 1] = (cfg_col_chat_prefix2 >= 0) ? cfg_col_chat_prefix2 & A_BOLD : 0; + color_attr[COLOR_WIN_CHAT_JOIN - 1] = (cfg_col_chat_join >= 0) ? cfg_col_chat_join & A_BOLD : 0; + color_attr[COLOR_WIN_CHAT_PART - 1] = (cfg_col_chat_part >= 0) ? cfg_col_chat_part & A_BOLD : 0; color_attr[COLOR_WIN_CHAT_NICK - 1] = (cfg_col_chat_nick >= 0) ? cfg_col_chat_nick & A_BOLD : 0; color_attr[COLOR_WIN_CHAT_HOST - 1] = (cfg_col_chat_host >= 0) ? cfg_col_chat_host & A_BOLD : 0; color_attr[COLOR_WIN_CHAT_CHANNEL - 1] = (cfg_col_chat_channel >= 0) ? cfg_col_chat_channel & A_BOLD : 0; diff --git a/src/gui/gui.h b/src/gui/gui.h index 94c277e51..96760a38a 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -26,52 +26,54 @@ #define INPUT_BUFFER_BLOCK_SIZE 256 -#define NUM_COLORS 52 +#define NUM_COLORS 54 #define COLOR_WIN_TITLE 1 #define COLOR_WIN_CHAT 2 #define COLOR_WIN_CHAT_TIME 3 #define COLOR_WIN_CHAT_TIME_SEP 4 #define COLOR_WIN_CHAT_PREFIX1 5 #define COLOR_WIN_CHAT_PREFIX2 6 -#define COLOR_WIN_CHAT_NICK 7 -#define COLOR_WIN_CHAT_HOST 8 -#define COLOR_WIN_CHAT_CHANNEL 9 -#define COLOR_WIN_CHAT_DARK 10 -#define COLOR_WIN_CHAT_HIGHLIGHT 11 -#define COLOR_WIN_STATUS 12 -#define COLOR_WIN_STATUS_DELIMITERS 13 -#define COLOR_WIN_STATUS_DATA_MSG 14 -#define COLOR_WIN_STATUS_DATA_PRIVATE 15 -#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 16 -#define COLOR_WIN_STATUS_DATA_OTHER 17 -#define COLOR_WIN_STATUS_MORE 18 -#define COLOR_WIN_INFOBAR 19 -#define COLOR_WIN_INFOBAR_DELIMITERS 20 -#define COLOR_WIN_INFOBAR_HIGHLIGHT 21 -#define COLOR_WIN_INPUT 22 -#define COLOR_WIN_INPUT_CHANNEL 23 -#define COLOR_WIN_INPUT_NICK 24 -#define COLOR_WIN_NICK 25 -#define COLOR_WIN_NICK_AWAY 26 -#define COLOR_WIN_NICK_CHANOWNER 27 -#define COLOR_WIN_NICK_CHANADMIN 28 -#define COLOR_WIN_NICK_OP 29 -#define COLOR_WIN_NICK_HALFOP 30 -#define COLOR_WIN_NICK_VOICE 31 -#define COLOR_WIN_NICK_MORE 32 -#define COLOR_WIN_NICK_SEP 33 -#define COLOR_WIN_NICK_SELF 34 -#define COLOR_WIN_NICK_PRIVATE 35 -#define COLOR_WIN_NICK_FIRST 36 -#define COLOR_WIN_NICK_LAST 45 +#define COLOR_WIN_CHAT_JOIN 7 +#define COLOR_WIN_CHAT_PART 8 +#define COLOR_WIN_CHAT_NICK 9 +#define COLOR_WIN_CHAT_HOST 10 +#define COLOR_WIN_CHAT_CHANNEL 11 +#define COLOR_WIN_CHAT_DARK 12 +#define COLOR_WIN_CHAT_HIGHLIGHT 13 +#define COLOR_WIN_STATUS 14 +#define COLOR_WIN_STATUS_DELIMITERS 15 +#define COLOR_WIN_STATUS_DATA_MSG 16 +#define COLOR_WIN_STATUS_DATA_PRIVATE 17 +#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 18 +#define COLOR_WIN_STATUS_DATA_OTHER 19 +#define COLOR_WIN_STATUS_MORE 20 +#define COLOR_WIN_INFOBAR 21 +#define COLOR_WIN_INFOBAR_DELIMITERS 22 +#define COLOR_WIN_INFOBAR_HIGHLIGHT 23 +#define COLOR_WIN_INPUT 24 +#define COLOR_WIN_INPUT_CHANNEL 25 +#define COLOR_WIN_INPUT_NICK 26 +#define COLOR_WIN_NICK 27 +#define COLOR_WIN_NICK_AWAY 28 +#define COLOR_WIN_NICK_CHANOWNER 29 +#define COLOR_WIN_NICK_CHANADMIN 30 +#define COLOR_WIN_NICK_OP 31 +#define COLOR_WIN_NICK_HALFOP 32 +#define COLOR_WIN_NICK_VOICE 33 +#define COLOR_WIN_NICK_MORE 34 +#define COLOR_WIN_NICK_SEP 35 +#define COLOR_WIN_NICK_SELF 36 +#define COLOR_WIN_NICK_PRIVATE 37 +#define COLOR_WIN_NICK_FIRST 38 +#define COLOR_WIN_NICK_LAST 47 #define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1) -#define COLOR_DCC_SELECTED 46 -#define COLOR_DCC_WAITING 47 -#define COLOR_DCC_CONNECTING 48 -#define COLOR_DCC_ACTIVE 49 -#define COLOR_DCC_DONE 50 -#define COLOR_DCC_FAILED 51 -#define COLOR_DCC_ABORTED 52 +#define COLOR_DCC_SELECTED 48 +#define COLOR_DCC_WAITING 49 +#define COLOR_DCC_CONNECTING 50 +#define COLOR_DCC_ACTIVE 51 +#define COLOR_DCC_DONE 52 +#define COLOR_DCC_FAILED 53 +#define COLOR_DCC_ABORTED 54 #define SERVER(buffer) ((t_irc_server *)(buffer->server)) #define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel)) diff --git a/src/irc/irc-display.c b/src/irc/irc-display.c index 0e182b1e8..2feb09e5a 100644 --- a/src/irc/irc-display.c +++ b/src/irc/irc-display.c @@ -57,7 +57,14 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix) gui_printf_type_color (buffer, type, COLOR_WIN_CHAT_PREFIX1, "%c ", prefix[2]); } else - gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix); + { + if (strcmp (prefix, PREFIX_JOIN) == 0) + gui_printf_color (buffer, COLOR_WIN_CHAT_JOIN, "%s ", prefix); + else if (strcmp (prefix, PREFIX_PART) == 0) + gui_printf_color (buffer, COLOR_WIN_CHAT_PART, "%s ", prefix); + else + gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix); + } } /* |