summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-curses-window.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-11-14 19:41:28 +0100
committerSebastien Helleu <flashcode@flashtux.org>2013-11-14 19:41:28 +0100
commit70ed2a8189b8b1cec9b4c14a5f4cdc7137912b2c (patch)
tree78f25effc031a212fe979fd3f2f7894f97050f00 /src/gui/curses/gui-curses-window.c
parentea9d79f2680517bc344372b8ec25163f81ba9aaa (diff)
downloadweechat-70ed2a8189b8b1cec9b4c14a5f4cdc7137912b2c.zip
core: apply color attributes when clearing a window (patch #8236) (patch from Tom Alsberg)
Diffstat (limited to 'src/gui/curses/gui-curses-window.c')
-rw-r--r--src/gui/curses/gui-curses-window.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 0406a905f..2d13cf712 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -176,7 +176,8 @@ gui_window_clear_weechat (WINDOW *window, int weechat_color)
if (!gui_init_ok)
return;
- wbkgdset (window, ' ' | COLOR_PAIR (gui_color_weechat_get_pair (weechat_color)));
+ wbkgdset (window, ' ' | COLOR_PAIR (gui_color_weechat_get_pair (weechat_color)) |
+ gui_color[weechat_color]->attributes);
werase (window);
wmove (window, 0, 0);
}
@@ -188,9 +189,13 @@ gui_window_clear_weechat (WINDOW *window, int weechat_color)
void
gui_window_clear (WINDOW *window, int fg, int bg)
{
+ int attrs;
+
if (!gui_init_ok)
return;
+ attrs = gui_color_get_extended_attrs (fg);
+
if ((fg > 0) && (fg & GUI_COLOR_EXTENDED_FLAG))
fg &= GUI_COLOR_EXTENDED_MASK;
else
@@ -201,7 +206,7 @@ gui_window_clear (WINDOW *window, int fg, int bg)
else
bg = gui_weechat_colors[bg & GUI_COLOR_EXTENDED_MASK].background;
- wbkgdset (window, ' ' | COLOR_PAIR (gui_color_get_pair (fg, bg)));
+ wbkgdset (window, ' ' | COLOR_PAIR (gui_color_get_pair (fg, bg)) | attrs);
werase (window);
wmove (window, 0, 0);
}
@@ -413,16 +418,8 @@ gui_window_set_custom_color_fg (WINDOW *window, int fg)
{
if (!(fg & GUI_COLOR_EXTENDED_KEEPATTR_FLAG))
gui_window_remove_color_style (window, A_ALL_ATTR);
- attributes = 0;
- if (fg & GUI_COLOR_EXTENDED_BOLD_FLAG)
- attributes |= A_BOLD;
- if (fg & GUI_COLOR_EXTENDED_REVERSE_FLAG)
- attributes |= A_REVERSE;
- if (fg & GUI_COLOR_EXTENDED_ITALIC_FLAG)
- attributes |= A_ITALIC;
- if (fg & GUI_COLOR_EXTENDED_UNDERLINE_FLAG)
- attributes |= A_UNDERLINE;
- attributes |= gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].attributes;
+ attributes = gui_color_get_extended_attrs (fg) |
+ gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].attributes;
gui_window_set_color_style (window, attributes);
fg = gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].foreground;
@@ -505,16 +502,8 @@ gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg)
{
if (!(fg & GUI_COLOR_EXTENDED_KEEPATTR_FLAG))
gui_window_remove_color_style (window, A_ALL_ATTR);
- attributes = 0;
- if (fg & GUI_COLOR_EXTENDED_BOLD_FLAG)
- attributes |= A_BOLD;
- if (fg & GUI_COLOR_EXTENDED_REVERSE_FLAG)
- attributes |= A_REVERSE;
- if (fg & GUI_COLOR_EXTENDED_ITALIC_FLAG)
- attributes |= A_ITALIC;
- if (fg & GUI_COLOR_EXTENDED_UNDERLINE_FLAG)
- attributes |= A_UNDERLINE;
- attributes |= gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].attributes;
+ attributes = gui_color_get_extended_attrs (fg) |
+ gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].attributes;
gui_window_set_color_style (window, attributes);
fg = gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].foreground;