summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-10-02 00:29:19 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-10-02 00:29:19 +0200
commit9605a8726f09e0c5648683c3f17f77facfaa0857 (patch)
treecf622abb6cb82e55aff7b32633fbf88ec7e44d2d /src/core
parent5ef4ecb5ab97bd763c396af749ddc9410e6516f6 (diff)
downloadweechat-9605a8726f09e0c5648683c3f17f77facfaa0857.zip
Add new option weechat.look.prefix_align_min (task #10650)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-config.c31
-rw-r--r--src/core/wee-config.h1
2 files changed, 32 insertions, 0 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index d1e4504b0..720f926a3 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -52,6 +52,7 @@
#include "../gui/gui-hotlist.h"
#include "../gui/gui-keyboard.h"
#include "../gui/gui-layout.h"
+#include "../gui/gui-line.h"
#include "../gui/gui-nicklist.h"
#include "../gui/gui-window.h"
#include "../plugins/plugin.h"
@@ -101,6 +102,7 @@ struct t_config_option *config_look_paste_max_lines;
struct t_config_option *config_look_prefix[GUI_CHAT_NUM_PREFIXES];
struct t_config_option *config_look_prefix_align;
struct t_config_option *config_look_prefix_align_max;
+struct t_config_option *config_look_prefix_align_min;
struct t_config_option *config_look_prefix_align_more;
struct t_config_option *config_look_prefix_buffer_align;
struct t_config_option *config_look_prefix_buffer_align_max;
@@ -322,6 +324,30 @@ config_change_prefix (void *data, struct t_config_option *option)
}
/*
+ * config_change_prefix_align_min: called when prefix_align_min is changed
+ */
+
+void
+config_change_prefix_align_min (void *data, struct t_config_option *option)
+{
+ struct t_gui_buffer *ptr_buffer;
+
+ /* make C compiler happy */
+ (void) data;
+ (void) option;
+
+ for (ptr_buffer = gui_buffers; ptr_buffer;
+ ptr_buffer = ptr_buffer->next_buffer)
+ {
+ if (ptr_buffer->own_lines)
+ gui_line_compute_prefix_max_length (ptr_buffer->own_lines);
+ if (ptr_buffer->mixed_lines)
+ gui_line_compute_prefix_max_length (ptr_buffer->mixed_lines);
+ }
+ gui_window_refresh_windows ();
+}
+
+/*
* config_change_color: called when a color is changed by /set command
*/
@@ -1434,6 +1460,11 @@ config_weechat_init_options ()
"prefix_align_max", "integer",
N_("max size for prefix (0 = no max size)"),
NULL, 0, 128, "0", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ config_look_prefix_align_min = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "prefix_align_min", "integer",
+ N_("min size for prefix"),
+ NULL, 0, 128, "0", NULL, 0, NULL, NULL, &config_change_prefix_align_min, NULL, NULL, NULL);
config_look_prefix_align_more = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_align_more", "boolean",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 362f1c3c5..70b872648 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -131,6 +131,7 @@ extern struct t_config_option *config_look_paste_max_lines;
extern struct t_config_option *config_look_prefix[];
extern struct t_config_option *config_look_prefix_align;
extern struct t_config_option *config_look_prefix_align_max;
+extern struct t_config_option *config_look_prefix_align_min;
extern struct t_config_option *config_look_prefix_align_more;
extern struct t_config_option *config_look_prefix_buffer_align;
extern struct t_config_option *config_look_prefix_buffer_align_max;