From a6363a7b0b49adafe7770ef0dd2fed95c6447096 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 3 Jun 2009 11:48:51 +0200 Subject: [PATCH] Fix display of bold/reverse/underline color attributes in bars --- src/gui/curses/gui-curses-bar-window.c | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c index c34b4f02a..cfc769911 100644 --- a/src/gui/curses/gui-curses-bar-window.c +++ b/src/gui/curses/gui-curses-bar-window.c @@ -276,6 +276,56 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window, CONFIG_INTEGER(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG])); string++; break; + case GUI_COLOR_SET_WEECHAT_CHAR: + string++; + switch (string[0]) + { + case GUI_COLOR_ATTR_BOLD_CHAR: + string++; + gui_window_set_color_style (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + A_BOLD); + break; + case GUI_COLOR_ATTR_REVERSE_CHAR: + string++; + gui_window_set_color_style (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + A_REVERSE); + break; + case GUI_COLOR_ATTR_ITALIC_CHAR: + /* not available in Curses GUI */ + string++; + break; + case GUI_COLOR_ATTR_UNDERLINE_CHAR: + string++; + gui_window_set_color_style (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + A_UNDERLINE); + break; + } + break; + case GUI_COLOR_REMOVE_WEECHAT_CHAR: + string++; + switch (string[0]) + { + case GUI_COLOR_ATTR_BOLD_CHAR: + string++; + gui_window_remove_color_style (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + A_BOLD); + break; + case GUI_COLOR_ATTR_REVERSE_CHAR: + string++; + gui_window_remove_color_style (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + A_REVERSE); + break; + case GUI_COLOR_ATTR_ITALIC_CHAR: + /* not available in Curses GUI */ + string++; + break; + case GUI_COLOR_ATTR_UNDERLINE_CHAR: + string++; + gui_window_remove_color_style (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + A_UNDERLINE); + break; + } + break; default: next_char = utf8_next_char (string); if (!next_char)