mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 07:16:37 +02:00
Added option "look_align_size_max", nick alignment to right is now set by default with size 14 (max 20)
This commit is contained in:
+10
-3
@@ -170,23 +170,30 @@
|
||||
<entry><option>look_align_nick</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>'none', 'left', 'right'</entry>
|
||||
<entry>'none'</entry>
|
||||
<entry>'right'</entry>
|
||||
<entry>Nick alignment (fixed size for nicks in chat window (none, left, right))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_other</option></entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>'on' or 'off'</entry>
|
||||
<entry>'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Alignment for other messages (not beginning with a nick)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size</option></entry>
|
||||
<entry>integer</entry>
|
||||
<entry>between 8 and 64</entry>
|
||||
<entry>8</entry>
|
||||
<entry>14</entry>
|
||||
<entry>Size for aligning nick and other messages</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size_max</option></entry>
|
||||
<entry>integer</entry>
|
||||
<entry>between 8 and 64</entry>
|
||||
<entry>20</entry>
|
||||
<entry>Max size for aligning nick and other messages (should be >= to look_align_size)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_completor</option></entry>
|
||||
<entry>string</entry>
|
||||
|
||||
+10
-3
@@ -170,23 +170,30 @@
|
||||
<entry><option>look_align_nick</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>'none', 'left', 'right'</entry>
|
||||
<entry>'none'</entry>
|
||||
<entry>'right'</entry>
|
||||
<entry>Alignement des pseudos (taille fixe pour les pseudos dans la fenêtre de discussion (none, left, right))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_other</option></entry>
|
||||
<entry>booléen</entry>
|
||||
<entry>'on' ou 'off'</entry>
|
||||
<entry>'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Alignement pour les autres messages (ne commençant pas par un pseudo)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size</option></entry>
|
||||
<entry>entier</entry>
|
||||
<entry>entre 8 et 64</entry>
|
||||
<entry>8</entry>
|
||||
<entry>14</entry>
|
||||
<entry>Taille pour l'alignement des pseudos et autres messages</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size_max</option></entry>
|
||||
<entry>entier</entry>
|
||||
<entry>entre 8 et 64</entry>
|
||||
<entry>20</entry>
|
||||
<entry>Taille maximum pour l'alignement des pseudos et autres messages (doit être >= à look_align_size)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_completor</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
|
||||
+308
-298
File diff suppressed because it is too large
Load Diff
@@ -94,6 +94,7 @@ char *cfg_look_align_nick_values[] =
|
||||
{ "none", "left", "right", NULL };
|
||||
int cfg_look_align_other;
|
||||
int cfg_look_align_size;
|
||||
int cfg_look_align_size_max;
|
||||
char *cfg_look_nick_completor;
|
||||
char *cfg_look_nick_completion_ignore;
|
||||
int cfg_look_nick_complete_first;
|
||||
@@ -209,15 +210,20 @@ t_config_option weechat_options_look[] =
|
||||
{ "look_align_nick", N_("nick alignment (fixed size for nicks in chat window)"),
|
||||
N_("nick alignment (fixed size for nicks in chat window (none, left, right))"),
|
||||
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
|
||||
"none", cfg_look_align_nick_values, &cfg_look_align_nick, NULL, config_change_noop },
|
||||
"right", cfg_look_align_nick_values, &cfg_look_align_nick, NULL, config_change_noop },
|
||||
{ "look_align_other", N_("alignment for other messages (not beginning with a nick)"),
|
||||
N_("alignment for other messages (not beginning with a nick)"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_align_other, NULL, config_change_noop },
|
||||
{ "look_align_size", N_("size for aligning nick and other messages"),
|
||||
N_("size for aligning nick and other messages"),
|
||||
OPTION_TYPE_INT, 8, 64, 8,
|
||||
OPTION_TYPE_INT, 8, 64, 14,
|
||||
NULL, NULL, &cfg_look_align_size, NULL, config_change_noop },
|
||||
{ "look_align_size_max", N_("max size for aligning nick and other messages"),
|
||||
N_("max size for aligning nick and other messages (should be >= to "
|
||||
"look_align_size)"),
|
||||
OPTION_TYPE_INT, 8, 64, 20,
|
||||
NULL, NULL, &cfg_look_align_size_max, NULL, config_change_noop },
|
||||
{ "look_nick_completor", N_("the string inserted after nick completion"),
|
||||
N_("the string inserted after nick completion"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
|
||||
@@ -113,6 +113,7 @@ extern char *cfg_look_nick_suffix;
|
||||
extern int cfg_look_align_nick;
|
||||
extern int cfg_look_align_other;
|
||||
extern int cfg_look_align_size;
|
||||
extern int cfg_look_align_size_max;
|
||||
extern char *cfg_look_nick_completor;
|
||||
extern char *cfg_look_nick_completion_ignore;
|
||||
extern int cfg_look_nick_complete_first;
|
||||
|
||||
+14
-3
@@ -150,7 +150,11 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
|
||||
int type, int display_around, int force_color, int no_nickmode)
|
||||
{
|
||||
char format[32], *ptr_nickname;
|
||||
int i, nickname_length, external_nick, length, spaces, disable_prefix_suffix;
|
||||
int max_align, i, nickname_length, external_nick, length, spaces;
|
||||
int disable_prefix_suffix;
|
||||
|
||||
max_align = (cfg_look_align_size_max >= cfg_look_align_size) ?
|
||||
cfg_look_align_size_max : cfg_look_align_size;
|
||||
|
||||
ptr_nickname = strdup ((nick) ? nick->nick : nickname);
|
||||
if (!ptr_nickname)
|
||||
@@ -159,7 +163,7 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
|
||||
external_nick = (!nick && !BUFFER_IS_PRIVATE(buffer));
|
||||
disable_prefix_suffix = ((cfg_look_align_nick != CFG_LOOK_ALIGN_NICK_NONE)
|
||||
&& ((int)strlen (cfg_look_nick_prefix) +
|
||||
(int)strlen (cfg_look_nick_suffix) > cfg_look_align_size - 4));
|
||||
(int)strlen (cfg_look_nick_suffix) > max_align - 4));
|
||||
|
||||
/* calculate length to display, to truncate it if too long */
|
||||
length = nickname_length;
|
||||
@@ -181,7 +185,14 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
|
||||
/* calculate number of spaces to insert before or after nick */
|
||||
spaces = 0;
|
||||
if (cfg_look_align_nick != CFG_LOOK_ALIGN_NICK_NONE)
|
||||
spaces = cfg_look_align_size - length;
|
||||
{
|
||||
if (length > max_align)
|
||||
spaces = max_align - length;
|
||||
else if (length > cfg_look_align_size)
|
||||
spaces = 0;
|
||||
else
|
||||
spaces = cfg_look_align_size - length;
|
||||
}
|
||||
|
||||
/* display prefix */
|
||||
if (display_around && !disable_prefix_suffix
|
||||
|
||||
@@ -170,23 +170,30 @@
|
||||
<entry><option>look_align_nick</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>'none', 'left', 'right'</entry>
|
||||
<entry>'none'</entry>
|
||||
<entry>'right'</entry>
|
||||
<entry>Nick alignment (fixed size for nicks in chat window (none, left, right))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_other</option></entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>'on' or 'off'</entry>
|
||||
<entry>'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Alignment for other messages (not beginning with a nick)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size</option></entry>
|
||||
<entry>integer</entry>
|
||||
<entry>between 8 and 64</entry>
|
||||
<entry>8</entry>
|
||||
<entry>14</entry>
|
||||
<entry>Size for aligning nick and other messages</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size_max</option></entry>
|
||||
<entry>integer</entry>
|
||||
<entry>between 8 and 64</entry>
|
||||
<entry>20</entry>
|
||||
<entry>Max size for aligning nick and other messages (should be >= to look_align_size)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_completor</option></entry>
|
||||
<entry>string</entry>
|
||||
|
||||
@@ -170,23 +170,30 @@
|
||||
<entry><option>look_align_nick</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>'none', 'left', 'right'</entry>
|
||||
<entry>'none'</entry>
|
||||
<entry>'right'</entry>
|
||||
<entry>Alignement des pseudos (taille fixe pour les pseudos dans la fenêtre de discussion (none, left, right))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_other</option></entry>
|
||||
<entry>booléen</entry>
|
||||
<entry>'on' ou 'off'</entry>
|
||||
<entry>'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Alignement pour les autres messages (ne commençant pas par un pseudo)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size</option></entry>
|
||||
<entry>entier</entry>
|
||||
<entry>entre 8 et 64</entry>
|
||||
<entry>8</entry>
|
||||
<entry>14</entry>
|
||||
<entry>Taille pour l'alignement des pseudos et autres messages</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size_max</option></entry>
|
||||
<entry>entier</entry>
|
||||
<entry>entre 8 et 64</entry>
|
||||
<entry>20</entry>
|
||||
<entry>Taille maximum pour l'alignement des pseudos et autres messages (doit être >= à look_align_size)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_completor</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
|
||||
+310
-298
File diff suppressed because it is too large
Load Diff
+310
-298
File diff suppressed because it is too large
Load Diff
+310
-298
File diff suppressed because it is too large
Load Diff
+311
-299
File diff suppressed because it is too large
Load Diff
+310
-298
File diff suppressed because it is too large
Load Diff
+308
-298
File diff suppressed because it is too large
Load Diff
@@ -94,6 +94,7 @@ char *cfg_look_align_nick_values[] =
|
||||
{ "none", "left", "right", NULL };
|
||||
int cfg_look_align_other;
|
||||
int cfg_look_align_size;
|
||||
int cfg_look_align_size_max;
|
||||
char *cfg_look_nick_completor;
|
||||
char *cfg_look_nick_completion_ignore;
|
||||
int cfg_look_nick_complete_first;
|
||||
@@ -209,15 +210,20 @@ t_config_option weechat_options_look[] =
|
||||
{ "look_align_nick", N_("nick alignment (fixed size for nicks in chat window)"),
|
||||
N_("nick alignment (fixed size for nicks in chat window (none, left, right))"),
|
||||
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
|
||||
"none", cfg_look_align_nick_values, &cfg_look_align_nick, NULL, config_change_noop },
|
||||
"right", cfg_look_align_nick_values, &cfg_look_align_nick, NULL, config_change_noop },
|
||||
{ "look_align_other", N_("alignment for other messages (not beginning with a nick)"),
|
||||
N_("alignment for other messages (not beginning with a nick)"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_align_other, NULL, config_change_noop },
|
||||
{ "look_align_size", N_("size for aligning nick and other messages"),
|
||||
N_("size for aligning nick and other messages"),
|
||||
OPTION_TYPE_INT, 8, 64, 8,
|
||||
OPTION_TYPE_INT, 8, 64, 14,
|
||||
NULL, NULL, &cfg_look_align_size, NULL, config_change_noop },
|
||||
{ "look_align_size_max", N_("max size for aligning nick and other messages"),
|
||||
N_("max size for aligning nick and other messages (should be >= to "
|
||||
"look_align_size)"),
|
||||
OPTION_TYPE_INT, 8, 64, 20,
|
||||
NULL, NULL, &cfg_look_align_size_max, NULL, config_change_noop },
|
||||
{ "look_nick_completor", N_("the string inserted after nick completion"),
|
||||
N_("the string inserted after nick completion"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
|
||||
@@ -113,6 +113,7 @@ extern char *cfg_look_nick_suffix;
|
||||
extern int cfg_look_align_nick;
|
||||
extern int cfg_look_align_other;
|
||||
extern int cfg_look_align_size;
|
||||
extern int cfg_look_align_size_max;
|
||||
extern char *cfg_look_nick_completor;
|
||||
extern char *cfg_look_nick_completion_ignore;
|
||||
extern int cfg_look_nick_complete_first;
|
||||
|
||||
@@ -150,7 +150,11 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
|
||||
int type, int display_around, int force_color, int no_nickmode)
|
||||
{
|
||||
char format[32], *ptr_nickname;
|
||||
int i, nickname_length, external_nick, length, spaces, disable_prefix_suffix;
|
||||
int max_align, i, nickname_length, external_nick, length, spaces;
|
||||
int disable_prefix_suffix;
|
||||
|
||||
max_align = (cfg_look_align_size_max >= cfg_look_align_size) ?
|
||||
cfg_look_align_size_max : cfg_look_align_size;
|
||||
|
||||
ptr_nickname = strdup ((nick) ? nick->nick : nickname);
|
||||
if (!ptr_nickname)
|
||||
@@ -159,7 +163,7 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
|
||||
external_nick = (!nick && !BUFFER_IS_PRIVATE(buffer));
|
||||
disable_prefix_suffix = ((cfg_look_align_nick != CFG_LOOK_ALIGN_NICK_NONE)
|
||||
&& ((int)strlen (cfg_look_nick_prefix) +
|
||||
(int)strlen (cfg_look_nick_suffix) > cfg_look_align_size - 4));
|
||||
(int)strlen (cfg_look_nick_suffix) > max_align - 4));
|
||||
|
||||
/* calculate length to display, to truncate it if too long */
|
||||
length = nickname_length;
|
||||
@@ -181,7 +185,14 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
|
||||
/* calculate number of spaces to insert before or after nick */
|
||||
spaces = 0;
|
||||
if (cfg_look_align_nick != CFG_LOOK_ALIGN_NICK_NONE)
|
||||
spaces = cfg_look_align_size - length;
|
||||
{
|
||||
if (length > max_align)
|
||||
spaces = max_align - length;
|
||||
else if (length > cfg_look_align_size)
|
||||
spaces = 0;
|
||||
else
|
||||
spaces = cfg_look_align_size - length;
|
||||
}
|
||||
|
||||
/* display prefix */
|
||||
if (display_around && !disable_prefix_suffix
|
||||
|
||||
Reference in New Issue
Block a user