diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-09-28 17:46:25 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-09-28 17:46:25 +0200 |
commit | 5ae4ef715a5bd70d73fd3836705007ef1892a78a (patch) | |
tree | 24a3423a936a6b4037555b65b290ee7dfffe3b59 /src | |
parent | 677a1b26b263120cd90e0cfd879949a9a5d7c0be (diff) | |
download | weechat-5ae4ef715a5bd70d73fd3836705007ef1892a78a.zip |
core: fix color of highlighted prefix on inactive window when option weechat.look.color_inactive_prefix is off
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/curses/gui-curses-chat.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index f028ee880..f54b31e11 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -533,7 +533,8 @@ gui_chat_display_time_to_prefix (struct t_gui_window *window, int *lines_displayed, int simulate) { - char str_space[] = " ", str_plus[] = "+", *prefix_highlighted; + char str_space[] = " ", str_plus[] = "+"; + char *prefix_no_color, *prefix_highlighted; const char *short_name; int i, length, length_allowed, num_spaces; struct t_gui_lines *mixed_lines; @@ -733,13 +734,25 @@ gui_chat_display_time_to_prefix (struct t_gui_window *window, prefix_highlighted = NULL; if (line->data->highlight) { - prefix_highlighted = gui_color_decode (line->data->prefix, NULL); + prefix_no_color = gui_color_decode (line->data->prefix, NULL); + if (prefix_no_color) + { + length = strlen (prefix_no_color) + 32; + prefix_highlighted = malloc (length); + if (prefix_highlighted) + { + snprintf (prefix_highlighted, length, "%s%s", + GUI_COLOR(GUI_COLOR_CHAT_HIGHLIGHT), + prefix_no_color); + } + free (prefix_no_color); + } if (!simulate) { gui_chat_reset_style (window, line, GUI_COLOR_CHAT_INACTIVE_WINDOW, (CONFIG_BOOLEAN(config_look_color_inactive_buffer) - && CONFIG_BOOLEAN(config_look_color_inactive_prefix_buffer) + && CONFIG_BOOLEAN(config_look_color_inactive_prefix) && (!line->data->buffer->active)) ? GUI_COLOR_CHAT_INACTIVE_BUFFER : GUI_COLOR_CHAT_HIGHLIGHT, @@ -753,7 +766,7 @@ gui_chat_display_time_to_prefix (struct t_gui_window *window, gui_chat_reset_style (window, line, GUI_COLOR_CHAT_INACTIVE_WINDOW, (CONFIG_BOOLEAN(config_look_color_inactive_buffer) - && CONFIG_BOOLEAN(config_look_color_inactive_prefix_buffer) + && CONFIG_BOOLEAN(config_look_color_inactive_prefix) && (!line->data->buffer->active)) ? GUI_COLOR_CHAT_INACTIVE_BUFFER : GUI_COLOR_CHAT, |