1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 22:06:38 +02:00

Fixed bug with nicklist size

This commit is contained in:
Sebastien Helleu
2008-01-03 14:21:49 +01:00
parent e3b52115c7
commit fd7b2f4fab
2 changed files with 13 additions and 10 deletions
+4 -1
View File
@@ -211,6 +211,7 @@ gui_nicklist_draw (struct t_gui_buffer *buffer, int erase)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick,
GUI_COLOR_NICKLIST);
chars_left = max_chars;
if (ptr_nick)
{
/* display spaces and prefix for nick */
@@ -222,12 +223,14 @@ gui_nicklist_draw (struct t_gui_buffer *buffer, int erase)
y, x, " ");
x++;
}
chars_left -= ptr_nick->group->level;
}
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick,
ptr_nick->prefix_color);
mvwprintw (GUI_CURSES(ptr_win)->win_nick,
y, x, "%c", ptr_nick->prefix);
x++;
chars_left--;
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick,
ptr_nick->color);
@@ -242,6 +245,7 @@ gui_nicklist_draw (struct t_gui_buffer *buffer, int erase)
y, x, " ");
x++;
}
chars_left -= ptr_group->level;
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick,
ptr_group->color);
//wattron (GUI_CURSES(ptr_win)->win_nick, A_UNDERLINE);
@@ -249,7 +253,6 @@ gui_nicklist_draw (struct t_gui_buffer *buffer, int erase)
}
wmove (GUI_CURSES(ptr_win)->win_nick, y, x);
saved_char = '\0';
chars_left = max_chars - ((ptr_nick) ? 1 : 0);
for (k = 0; k < chars_left; k++)
{
if (ptr_buf && ptr_buf[0])
+9 -9
View File
@@ -220,7 +220,7 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
max_length = CONFIG_INTEGER(config_look_nicklist_max_size);
if (!force_calculate
&& (window->win_nick_width ==
max_length + 1 + ((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0)))
max_length + ((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0)))
return 0;
}
else
@@ -250,14 +250,14 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
switch (CONFIG_INTEGER(config_look_nicklist_position))
{
case CONFIG_LOOK_NICKLIST_LEFT:
window->win_chat_x = window->win_x + max_length + 1 +
window->win_chat_x = window->win_x + max_length +
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_chat_y = window->win_y + 1;
window->win_chat_width = window->win_width - max_length - 1 -
window->win_chat_width = window->win_width - max_length -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_nick_x = window->win_x + 0;
window->win_nick_y = window->win_y + 1;
window->win_nick_width = max_length + 1 +
window->win_nick_width = max_length +
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
if (CONFIG_BOOLEAN(config_look_infobar))
{
@@ -274,13 +274,13 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
case CONFIG_LOOK_NICKLIST_RIGHT:
window->win_chat_x = window->win_x;
window->win_chat_y = window->win_y + 1;
window->win_chat_width = window->win_width - max_length - 1 -
window->win_chat_width = window->win_width - max_length -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_nick_x = window->win_x + window->win_width -
max_length - 1 -
max_length -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_nick_y = window->win_y + 1;
window->win_nick_width = max_length + 1 +
window->win_nick_width = max_length +
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
if (CONFIG_BOOLEAN(config_look_infobar))
{
@@ -310,7 +310,7 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
window->win_nick_width = window->win_width;
window->win_nick_height = lines +
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2));
window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 1));
break;
case CONFIG_LOOK_NICKLIST_BOTTOM:
window->win_chat_x = window->win_x;
@@ -334,7 +334,7 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
window->win_nick_width = window->win_width;
window->win_nick_height = lines +
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2));
window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 1));
break;
}