diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-11-17 20:40:23 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-11-17 20:40:23 +0000 |
commit | 4061f34127ccf0c912a8eb94c059f260ecda0b2a (patch) | |
tree | db4bef7151a01000044005477d4734d422d6d49e /src/gui/curses | |
parent | cad95b8f32a75080e60a50af3503d46e7feac12b (diff) | |
download | weechat-4061f34127ccf0c912a8eb94c059f260ecda0b2a.zip |
Added option "look_nicklist_separator" (task #5437)
Diffstat (limited to 'src/gui/curses')
-rw-r--r-- | src/gui/curses/gui-curses-nicklist.c | 16 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-window.c | 34 |
2 files changed, 26 insertions, 24 deletions
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; } |