summaryrefslogtreecommitdiff
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
parent8a61b0eee0184e14130e8975a96c2c79e62c2f58 (diff)
downloadweechat-d256d72eefe846130376ba7cafbb57c6b9b22188.zip
Fixed look_nicklist_min_size and look_nicklist_max_size options
-rw-r--r--ChangeLog3
-rw-r--r--src/gui/curses/gui-display.c15
-rw-r--r--weechat/ChangeLog3
-rw-r--r--weechat/src/gui/curses/gui-display.c15
4 files changed, 32 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 25ba8fe19..ae60d9b8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2005-07-31
+ChangeLog - 2005-08-16
Version 0.1.5 (under dev!):
+ * fixed look_nicklist_min_size and look_nicklist_max_size options
* fixed refresh bug when changing channel modes
* jump to next server now saves current channel buffer for each server
* ctrl-up/ctrl-down keys added to call previous/next command in global
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 ())
{
diff --git a/weechat/ChangeLog b/weechat/ChangeLog
index 25ba8fe19..ae60d9b8b 100644
--- a/weechat/ChangeLog
+++ b/weechat/ChangeLog
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2005-07-31
+ChangeLog - 2005-08-16
Version 0.1.5 (under dev!):
+ * fixed look_nicklist_min_size and look_nicklist_max_size options
* fixed refresh bug when changing channel modes
* jump to next server now saves current channel buffer for each server
* ctrl-up/ctrl-down keys added to call previous/next command in global
diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c
index e1816a40c..12a8cd0a1 100644
--- a/weechat/src/gui/curses/gui-display.c
+++ b/weechat/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 ())
{