From 83a7305bae5c2a88740fd7e2936ee3ddc52423f0 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 22 Sep 2011 23:49:28 +0200 Subject: [PATCH] core: fix option weechat.look.color_inactive_message --- src/gui/curses/gui-curses-chat.c | 36 +++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index 822aca386..0b2196a21 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -283,10 +283,20 @@ gui_chat_string_next_char (struct t_gui_window *window, struct t_gui_line *line, case GUI_COLOR_RESET_CHAR: string++; if (apply_style) - gui_chat_reset_style (window, line, - GUI_COLOR_CHAT_INACTIVE_WINDOW, - GUI_COLOR_CHAT_INACTIVE_BUFFER, - GUI_COLOR_CHAT); + { + if (apply_style_inactive) + { + gui_chat_reset_style (window, line, + GUI_COLOR_CHAT_INACTIVE_WINDOW, + GUI_COLOR_CHAT_INACTIVE_BUFFER, + GUI_COLOR_CHAT); + } + else + { + gui_window_reset_style (GUI_WINDOW_OBJECTS(window)->win_chat, + GUI_COLOR_CHAT); + } + } break; default: return (char *)string; @@ -922,10 +932,20 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line, /* reset color & style for a new line */ if (!simulate) { - gui_chat_reset_style (window, line, - GUI_COLOR_CHAT_INACTIVE_WINDOW, - GUI_COLOR_CHAT_INACTIVE_BUFFER, - GUI_COLOR_CHAT); + if (CONFIG_BOOLEAN(config_look_color_inactive_message)) + { + gui_chat_reset_style (window, line, + GUI_COLOR_CHAT_INACTIVE_WINDOW, + GUI_COLOR_CHAT_INACTIVE_BUFFER, + GUI_COLOR_CHAT); + } + else + { + gui_chat_reset_style (window, line, + GUI_COLOR_CHAT, + GUI_COLOR_CHAT, + GUI_COLOR_CHAT); + } } if (!line->data->message || !line->data->message[0])