summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-12-14 15:50:09 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-12-14 15:50:09 +0100
commit9bfc6a6fd1536fe488d64b064bd698a3773a1de1 (patch)
tree73e2129f129baf366aba056090be3fa2a300c694 /src
parentc1e1e405596e264163ed897cfce2575b446ebd1f (diff)
downloadweechat-9bfc6a6fd1536fe488d64b064bd698a3773a1de1.zip
Add new option weechat.color.status_time
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-config.c7
-rw-r--r--src/core/wee-config.h1
-rw-r--r--src/gui/gui-bar-item.c8
3 files changed, 14 insertions, 2 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 843ca00a1..152d2649f 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -142,6 +142,7 @@ struct t_config_option *config_color_status_data_private;
struct t_config_option *config_color_status_data_highlight;
struct t_config_option *config_color_status_data_other;
struct t_config_option *config_color_status_more;
+struct t_config_option *config_color_status_time;
struct t_config_option *config_color_input_text_not_found;
struct t_config_option *config_color_input_actions;
struct t_config_option *config_color_nicklist_group;
@@ -1763,6 +1764,12 @@ config_weechat_init_options ()
N_("text color for buffer with new data (status bar)"),
NULL, -1, 0, "yellow", NULL, 0,
NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_status_time = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "status_time", "color",
+ N_("text color for time (status bar)"),
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
/* input window */
config_color_input_text_not_found = config_file_new_option (
weechat_config_file, ptr_section,
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 48e2312d8..3bb125574 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -155,6 +155,7 @@ extern struct t_config_option *config_color_status_data_private;
extern struct t_config_option *config_color_status_data_highlight;
extern struct t_config_option *config_color_status_data_other;
extern struct t_config_option *config_color_status_more;
+extern struct t_config_option *config_color_status_time;
extern struct t_config_option *config_color_input_text_not_found;
extern struct t_config_option *config_color_input_actions;
extern struct t_config_option *config_color_nicklist_group;
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index ffe3810d2..54c7e2860 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -755,7 +755,7 @@ gui_bar_item_default_time (void *data, struct t_gui_bar_item *item,
{
time_t date;
struct tm *local_time;
- char text_time[128];
+ char text_time[128], text_time2[128];
/* make C compiler happy */
(void) data;
@@ -769,7 +769,11 @@ gui_bar_item_default_time (void *data, struct t_gui_bar_item *item,
local_time) == 0)
return NULL;
- return strdup (text_time);
+ snprintf (text_time2, sizeof (text_time2), "%s%s",
+ gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_status_time))),
+ text_time);
+
+ return strdup (text_time2);
}
/*