summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-08-16 21:01:32 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-08-16 21:01:32 +0000
commitd256d72eefe846130376ba7cafbb57c6b9b22188 (patch)
treed108ea0be36ccfd8253ded36b750953006ded0c8 /src
parent8a61b0eee0184e14130e8975a96c2c79e62c2f58 (diff)
downloadweechat-d256d72eefe846130376ba7cafbb57c6b9b22188.zip
Fixed look_nicklist_min_size and look_nicklist_max_size options
Diffstat (limited to 'src')
-rw-r--r--src/gui/curses/gui-display.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c
index e1816a40c..12a8cd0a1 100644
--- a/src/gui/curses/gui-display.c
+++ b/src/gui/curses/gui-display.c
@@ -184,6 +184,13 @@ gui_calculate_pos_size (t_gui_window *window)
{
max_length = nick_get_max_length (CHANNEL(window->buffer));
+ if ((cfg_look_nicklist_min_size > 0)
+ && (max_length < cfg_look_nicklist_min_size))
+ max_length = cfg_look_nicklist_min_size;
+ else if ((cfg_look_nicklist_max_size > 0)
+ && (max_length > cfg_look_nicklist_max_size))
+ max_length = cfg_look_nicklist_max_size;
+
switch (cfg_look_nicklist_position)
{
case CFG_LOOK_NICKLIST_LEFT:
@@ -921,7 +928,13 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
mvwprintw (ptr_win->win_nick, i, 0, format_empty, " ");
}
}
- snprintf (format, 32, "%%-%ds", max_length);
+ snprintf (format, 32, "%%.%ds",
+ ((cfg_look_nicklist_min_size > 0)
+ && (max_length < cfg_look_nicklist_min_size)) ?
+ cfg_look_nicklist_min_size :
+ (((cfg_look_nicklist_max_size > 0)
+ && (max_length > cfg_look_nicklist_max_size)) ?
+ cfg_look_nicklist_max_size : max_length));
if (has_colors ())
{