1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

core: fix reset of attributes in bars when "resetcolor" is used (closes #41)

This commit is contained in:
Sebastien Helleu
2014-03-30 08:34:32 +02:00
parent 5c1e5988f9
commit 0cfbae1512
4 changed files with 19 additions and 10 deletions
+1
View File
@@ -15,6 +15,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
== Version 0.4.4 (under dev)
* core: fix reset of attributes in bars when "resetcolor" is used (closes #41)
* core: fix alignment of lines in merged buffers when options
weechat.look.prefix_align and weechat.look.prefix_buffer_align are set to
"none" (closes #43)
+12 -6
View File
@@ -169,7 +169,8 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
{
gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]),
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]),
1);
}
x_with_hidden = *x;
@@ -289,7 +290,8 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
string++;
gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]),
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]),
0);
break;
default:
gui_window_string_apply_color_weechat ((unsigned char **)&string,
@@ -313,7 +315,8 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
A_ALL_ATTR);
gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]),
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]),
1);
break;
default:
next_char = utf8_next_char (string);
@@ -640,7 +643,8 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
{
gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]),
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]),
1);
gui_window_remove_color_style (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
A_ALL_ATTR);
wclrtobot (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar);
@@ -684,7 +688,8 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
{
gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
CONFIG_COLOR(config_color_bar_more),
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]),
1);
mvwaddstr (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
y, x, ptr_string);
}
@@ -703,7 +708,8 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
{
gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
CONFIG_COLOR(config_color_bar_more),
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]),
1);
mvwaddstr (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
y, x, ptr_string);
}
+4 -3
View File
@@ -475,7 +475,8 @@ gui_window_set_custom_color_bg (WINDOW *window, int bg)
*/
void
gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg)
gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg,
int reset_attributes)
{
int attributes;
@@ -503,7 +504,7 @@ gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg)
}
else if ((fg & GUI_COLOR_EXTENDED_MASK) < GUI_CURSES_NUM_WEECHAT_COLORS)
{
if (!(fg & GUI_COLOR_EXTENDED_KEEPATTR_FLAG))
if (reset_attributes && !(fg & GUI_COLOR_EXTENDED_KEEPATTR_FLAG))
gui_window_remove_color_style (window, A_ALL_ATTR);
attributes = gui_color_get_extended_attrs (fg) |
gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].attributes;
@@ -844,7 +845,7 @@ gui_window_string_apply_color_fg_bg (unsigned char **string, WINDOW *window)
}
if (window && (fg >= 0) && (bg >= 0))
{
gui_window_set_custom_color_fg_bg (window, fg, bg);
gui_window_set_custom_color_fg_bg (window, fg, bg, 1);
}
*string = ptr_string;
+2 -1
View File
@@ -108,7 +108,8 @@ extern void gui_window_set_color_style (WINDOW *window, int style);
extern void gui_window_remove_color_style (WINDOW *window, int style);
extern void gui_window_set_color (WINDOW *window, int fg, int bg);
extern void gui_window_set_weechat_color (WINDOW *window, int num_color);
extern void gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg);
extern void gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg,
int reset_attributes);
extern void gui_window_set_custom_color_pair (WINDOW *window, int pair);
extern void gui_window_set_custom_color_fg (WINDOW *window, int fg);
extern void gui_window_set_custom_color_bg (WINDOW *window, int bg);