diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/common/weeconfig.c | 6 | ||||
-rw-r--r-- | src/common/weeconfig.h | 1 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-nicklist.c | 16 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-window.c | 34 | ||||
-rw-r--r-- | weechat/ChangeLog | 3 | ||||
-rw-r--r-- | weechat/src/common/weeconfig.c | 6 | ||||
-rw-r--r-- | weechat/src/common/weeconfig.h | 1 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-curses-nicklist.c | 16 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-curses-window.c | 34 |
10 files changed, 70 insertions, 50 deletions
@@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-11-14 +ChangeLog - 2006-11-17 Version 0.2.2 (under dev!): + * added option "look_nicklist_separator" (task #5437) * fixed bug with DCC SEND when filename begins with '~' * added "irc_send_unknown_commands" option to send unknown commands to IRC server (OFF by default) (task #5947) diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c index f42d62b2e..90d08378c 100644 --- a/src/common/weeconfig.c +++ b/src/common/weeconfig.c @@ -83,6 +83,7 @@ char *cfg_look_nicklist_position_values[] = { "left", "right", "top", "bottom", NULL }; int cfg_look_nicklist_min_size; int cfg_look_nicklist_max_size; +int cfg_look_nicklist_separator; int cfg_look_nickmode; int cfg_look_nickmode_empty; char *cfg_look_no_nickname; @@ -172,6 +173,10 @@ t_config_option weechat_options_look[] = "(0 = no max size; if min == max and > 0, then size is fixed))"), OPTION_TYPE_INT, 0, 100, 0, NULL, NULL, &cfg_look_nicklist_max_size, NULL, config_change_buffers }, + { "look_nicklist_separator", N_("separator between chat and nicklist"), + N_("separator between chat and nicklist"), + OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, + NULL, NULL, &cfg_look_nicklist_separator, NULL, config_change_buffers }, { "look_no_nickname", N_("text to display instead of nick when not connected"), N_("text to display instead of nick when not connected"), OPTION_TYPE_STRING, 0, 0, 0, @@ -325,6 +330,7 @@ int cfg_col_nick_self; int cfg_col_nick_colors[COLOR_WIN_NICK_NUMBER]; int cfg_col_nick_private; int cfg_col_nick_bg; +int cfg_col_nicklist_bg; int cfg_col_dcc_selected; int cfg_col_dcc_waiting; int cfg_col_dcc_connecting; diff --git a/src/common/weeconfig.h b/src/common/weeconfig.h index 3eeeb51fd..4407fd9d9 100644 --- a/src/common/weeconfig.h +++ b/src/common/weeconfig.h @@ -102,6 +102,7 @@ extern int cfg_look_nicklist; extern int cfg_look_nicklist_position; extern int cfg_look_nicklist_min_size; extern int cfg_look_nicklist_max_size; +extern int cfg_look_nicklist_separator; extern int cfg_look_nickmode; extern int cfg_look_nickmode_empty; extern char *cfg_look_no_nickname; diff --git a/src/gui/curses/gui-curses-nicklist.c b/src/gui/curses/gui-curses-nicklist.c index 5aa5a8b6d..58d5c0719 100644 --- a/src/gui/curses/gui-curses-nicklist.c +++ b/src/gui/curses/gui-curses-nicklist.c @@ -91,7 +91,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size) && (max_length > cfg_look_nicklist_max_size)) ? cfg_look_nicklist_max_size : max_length)); - if (has_colors ()) + if (cfg_look_nicklist_separator && has_colors ()) { gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_SEP); switch (cfg_look_nicklist_position) @@ -121,12 +121,12 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size) gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK); x = 0; - y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0; + y = (cfg_look_nicklist_separator && (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ? 1 : 0; column = 0; if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) || (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) - nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_nick_height - 1); + nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_nick_height - cfg_look_nicklist_separator); else nicks_displayed = ptr_win->win_nick_height; @@ -147,7 +147,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size) x = 0; break; case CFG_LOOK_NICKLIST_RIGHT: - x = 1; + x = cfg_look_nicklist_separator; break; case CFG_LOOK_NICKLIST_TOP: case CFG_LOOK_NICKLIST_BOTTOM: @@ -214,11 +214,13 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size) if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) || (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) { - if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1) + if (y - ((cfg_look_nicklist_separator + && (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ? 1 : 0) + >= ptr_win->win_nick_height - 1) { column += max_length + 2; - y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ? - 0 : 1; + y = (cfg_look_nicklist_separator && (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ? + 1 : 0; } } } diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index 5794e771e..769cf20d0 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -219,7 +219,7 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) else if ((cfg_look_nicklist_max_size > 0) && (max_length > cfg_look_nicklist_max_size)) max_length = cfg_look_nicklist_max_size; - if (!force_calculate && (window->win_nick_width == max_length + 2)) + if (!force_calculate && (window->win_nick_width == max_length + 1 + cfg_look_nicklist_separator)) return 0; } else @@ -241,19 +241,19 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) window->win_height - add_top - add_bottom - 2 - 4; if (lines > max_height) lines = max_height; - if (!force_calculate && (window->win_nick_height == lines + 1)) + if (!force_calculate && (window->win_nick_height == lines + cfg_look_nicklist_separator)) return 0; } switch (cfg_look_nicklist_position) { case CFG_LOOK_NICKLIST_LEFT: - window->win_chat_x = window->win_x + add_left + max_length + 2; + window->win_chat_x = window->win_x + add_left + max_length + 1 + cfg_look_nicklist_separator; window->win_chat_y = window->win_y + add_top + 1; - window->win_chat_width = window->win_width - add_left - add_right - max_length - 2; + window->win_chat_width = window->win_width - add_left - add_right - max_length - 1 - cfg_look_nicklist_separator; window->win_nick_x = window->win_x + add_left + 0; window->win_nick_y = window->win_y + add_top + 1; - window->win_nick_width = max_length + 2; + window->win_nick_width = max_length + 1 + cfg_look_nicklist_separator; if (cfg_look_infobar) { window->win_chat_height = window->win_height - add_top - add_bottom - 4; @@ -269,10 +269,10 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) case CFG_LOOK_NICKLIST_RIGHT: window->win_chat_x = window->win_x + add_left; window->win_chat_y = window->win_y + add_top + 1; - window->win_chat_width = window->win_width - add_left - add_right - max_length - 2; - window->win_nick_x = window->win_x + window->win_width - add_right - max_length - 2; + window->win_chat_width = window->win_width - add_left - add_right - max_length - 1 - cfg_look_nicklist_separator; + window->win_nick_x = window->win_x + window->win_width - add_right - max_length - 1 - cfg_look_nicklist_separator; window->win_nick_y = window->win_y + add_top + 1; - window->win_nick_width = max_length + 2; + window->win_nick_width = max_length + 1 + cfg_look_nicklist_separator; if (cfg_look_infobar) { window->win_chat_height = window->win_height - add_top - add_bottom - 4; @@ -287,16 +287,16 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) break; case CFG_LOOK_NICKLIST_TOP: window->win_chat_x = window->win_x + add_left; - window->win_chat_y = window->win_y + add_top + 1 + (lines + 1); + window->win_chat_y = window->win_y + add_top + 1 + lines + cfg_look_nicklist_separator; window->win_chat_width = window->win_width - add_left - add_right; if (cfg_look_infobar) - window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1) - 1; + window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator - 1; else - window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1); + window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator; window->win_nick_x = window->win_x + add_left; window->win_nick_y = window->win_y + add_top + 1; window->win_nick_width = window->win_width - add_left - add_right; - window->win_nick_height = lines + 1; + window->win_nick_height = lines + cfg_look_nicklist_separator; window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2)); break; case CFG_LOOK_NICKLIST_BOTTOM: @@ -304,16 +304,16 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) window->win_chat_y = window->win_y + add_top + 1; window->win_chat_width = window->win_width - add_left - add_right; if (cfg_look_infobar) - window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1) - 1; + window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator - 1; else - window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1); + window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator; window->win_nick_x = window->win_x + add_left; if (cfg_look_infobar) - window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - (lines + 1) - 1; + window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - lines - cfg_look_nicklist_separator - 1; else - window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - (lines + 1); + window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - lines - cfg_look_nicklist_separator; window->win_nick_width = window->win_width - add_left - add_right; - window->win_nick_height = lines + 1; + window->win_nick_height = lines + cfg_look_nicklist_separator; window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2)); break; } diff --git a/weechat/ChangeLog b/weechat/ChangeLog index ef5fec159..035805f60 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-11-14 +ChangeLog - 2006-11-17 Version 0.2.2 (under dev!): + * added option "look_nicklist_separator" (task #5437) * fixed bug with DCC SEND when filename begins with '~' * added "irc_send_unknown_commands" option to send unknown commands to IRC server (OFF by default) (task #5947) diff --git a/weechat/src/common/weeconfig.c b/weechat/src/common/weeconfig.c index f42d62b2e..90d08378c 100644 --- a/weechat/src/common/weeconfig.c +++ b/weechat/src/common/weeconfig.c @@ -83,6 +83,7 @@ char *cfg_look_nicklist_position_values[] = { "left", "right", "top", "bottom", NULL }; int cfg_look_nicklist_min_size; int cfg_look_nicklist_max_size; +int cfg_look_nicklist_separator; int cfg_look_nickmode; int cfg_look_nickmode_empty; char *cfg_look_no_nickname; @@ -172,6 +173,10 @@ t_config_option weechat_options_look[] = "(0 = no max size; if min == max and > 0, then size is fixed))"), OPTION_TYPE_INT, 0, 100, 0, NULL, NULL, &cfg_look_nicklist_max_size, NULL, config_change_buffers }, + { "look_nicklist_separator", N_("separator between chat and nicklist"), + N_("separator between chat and nicklist"), + OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, + NULL, NULL, &cfg_look_nicklist_separator, NULL, config_change_buffers }, { "look_no_nickname", N_("text to display instead of nick when not connected"), N_("text to display instead of nick when not connected"), OPTION_TYPE_STRING, 0, 0, 0, @@ -325,6 +330,7 @@ int cfg_col_nick_self; int cfg_col_nick_colors[COLOR_WIN_NICK_NUMBER]; int cfg_col_nick_private; int cfg_col_nick_bg; +int cfg_col_nicklist_bg; int cfg_col_dcc_selected; int cfg_col_dcc_waiting; int cfg_col_dcc_connecting; diff --git a/weechat/src/common/weeconfig.h b/weechat/src/common/weeconfig.h index 3eeeb51fd..4407fd9d9 100644 --- a/weechat/src/common/weeconfig.h +++ b/weechat/src/common/weeconfig.h @@ -102,6 +102,7 @@ extern int cfg_look_nicklist; extern int cfg_look_nicklist_position; extern int cfg_look_nicklist_min_size; extern int cfg_look_nicklist_max_size; +extern int cfg_look_nicklist_separator; extern int cfg_look_nickmode; extern int cfg_look_nickmode_empty; extern char *cfg_look_no_nickname; diff --git a/weechat/src/gui/curses/gui-curses-nicklist.c b/weechat/src/gui/curses/gui-curses-nicklist.c index 5aa5a8b6d..58d5c0719 100644 --- a/weechat/src/gui/curses/gui-curses-nicklist.c +++ b/weechat/src/gui/curses/gui-curses-nicklist.c @@ -91,7 +91,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size) && (max_length > cfg_look_nicklist_max_size)) ? cfg_look_nicklist_max_size : max_length)); - if (has_colors ()) + if (cfg_look_nicklist_separator && has_colors ()) { gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_SEP); switch (cfg_look_nicklist_position) @@ -121,12 +121,12 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size) gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK); x = 0; - y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0; + y = (cfg_look_nicklist_separator && (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ? 1 : 0; column = 0; if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) || (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) - nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_nick_height - 1); + nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_nick_height - cfg_look_nicklist_separator); else nicks_displayed = ptr_win->win_nick_height; @@ -147,7 +147,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size) x = 0; break; case CFG_LOOK_NICKLIST_RIGHT: - x = 1; + x = cfg_look_nicklist_separator; break; case CFG_LOOK_NICKLIST_TOP: case CFG_LOOK_NICKLIST_BOTTOM: @@ -214,11 +214,13 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size) if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) || (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) { - if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1) + if (y - ((cfg_look_nicklist_separator + && (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ? 1 : 0) + >= ptr_win->win_nick_height - 1) { column += max_length + 2; - y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ? - 0 : 1; + y = (cfg_look_nicklist_separator && (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ? + 1 : 0; } } } diff --git a/weechat/src/gui/curses/gui-curses-window.c b/weechat/src/gui/curses/gui-curses-window.c index 5794e771e..769cf20d0 100644 --- a/weechat/src/gui/curses/gui-curses-window.c +++ b/weechat/src/gui/curses/gui-curses-window.c @@ -219,7 +219,7 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) else if ((cfg_look_nicklist_max_size > 0) && (max_length > cfg_look_nicklist_max_size)) max_length = cfg_look_nicklist_max_size; - if (!force_calculate && (window->win_nick_width == max_length + 2)) + if (!force_calculate && (window->win_nick_width == max_length + 1 + cfg_look_nicklist_separator)) return 0; } else @@ -241,19 +241,19 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) window->win_height - add_top - add_bottom - 2 - 4; if (lines > max_height) lines = max_height; - if (!force_calculate && (window->win_nick_height == lines + 1)) + if (!force_calculate && (window->win_nick_height == lines + cfg_look_nicklist_separator)) return 0; } switch (cfg_look_nicklist_position) { case CFG_LOOK_NICKLIST_LEFT: - window->win_chat_x = window->win_x + add_left + max_length + 2; + window->win_chat_x = window->win_x + add_left + max_length + 1 + cfg_look_nicklist_separator; window->win_chat_y = window->win_y + add_top + 1; - window->win_chat_width = window->win_width - add_left - add_right - max_length - 2; + window->win_chat_width = window->win_width - add_left - add_right - max_length - 1 - cfg_look_nicklist_separator; window->win_nick_x = window->win_x + add_left + 0; window->win_nick_y = window->win_y + add_top + 1; - window->win_nick_width = max_length + 2; + window->win_nick_width = max_length + 1 + cfg_look_nicklist_separator; if (cfg_look_infobar) { window->win_chat_height = window->win_height - add_top - add_bottom - 4; @@ -269,10 +269,10 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) case CFG_LOOK_NICKLIST_RIGHT: window->win_chat_x = window->win_x + add_left; window->win_chat_y = window->win_y + add_top + 1; - window->win_chat_width = window->win_width - add_left - add_right - max_length - 2; - window->win_nick_x = window->win_x + window->win_width - add_right - max_length - 2; + window->win_chat_width = window->win_width - add_left - add_right - max_length - 1 - cfg_look_nicklist_separator; + window->win_nick_x = window->win_x + window->win_width - add_right - max_length - 1 - cfg_look_nicklist_separator; window->win_nick_y = window->win_y + add_top + 1; - window->win_nick_width = max_length + 2; + window->win_nick_width = max_length + 1 + cfg_look_nicklist_separator; if (cfg_look_infobar) { window->win_chat_height = window->win_height - add_top - add_bottom - 4; @@ -287,16 +287,16 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) break; case CFG_LOOK_NICKLIST_TOP: window->win_chat_x = window->win_x + add_left; - window->win_chat_y = window->win_y + add_top + 1 + (lines + 1); + window->win_chat_y = window->win_y + add_top + 1 + lines + cfg_look_nicklist_separator; window->win_chat_width = window->win_width - add_left - add_right; if (cfg_look_infobar) - window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1) - 1; + window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator - 1; else - window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1); + window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator; window->win_nick_x = window->win_x + add_left; window->win_nick_y = window->win_y + add_top + 1; window->win_nick_width = window->win_width - add_left - add_right; - window->win_nick_height = lines + 1; + window->win_nick_height = lines + cfg_look_nicklist_separator; window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2)); break; case CFG_LOOK_NICKLIST_BOTTOM: @@ -304,16 +304,16 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate) window->win_chat_y = window->win_y + add_top + 1; window->win_chat_width = window->win_width - add_left - add_right; if (cfg_look_infobar) - window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1) - 1; + window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator - 1; else - window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1); + window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator; window->win_nick_x = window->win_x + add_left; if (cfg_look_infobar) - window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - (lines + 1) - 1; + window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - lines - cfg_look_nicklist_separator - 1; else - window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - (lines + 1); + window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - lines - cfg_look_nicklist_separator; window->win_nick_width = window->win_width - add_left - add_right; - window->win_nick_height = lines + 1; + window->win_nick_height = lines + cfg_look_nicklist_separator; window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2)); break; } |