summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-10-01 12:25:40 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-10-01 12:25:40 +0200
commit013e039241aa19daf66ecc00ad425cccf1890941 (patch)
treeb76c27c54ec7e9c773a407be72c7633e1cb9ab0e /src
parentf51e3020e1181cab85591701fcc6b38afd183f57 (diff)
downloadweechat-013e039241aa19daf66ecc00ad425cccf1890941.zip
Fill items in bars with spaces when filling is vertical
Diffstat (limited to 'src')
-rw-r--r--src/gui/curses/gui-curses-bar.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/gui/curses/gui-curses-bar.c b/src/gui/curses/gui-curses-bar.c
index 96d150f63..435a29d4a 100644
--- a/src/gui/curses/gui-curses-bar.c
+++ b/src/gui/curses/gui-curses-bar.c
@@ -664,7 +664,8 @@ gui_bar_window_add_missing_bars (struct t_gui_window *window)
int
gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
int *x, int *y,
- const char *string)
+ const char *string,
+ int reset_color_before_display)
{
int weechat_color, size_on_screen, fg, bg;
char str_fg[3], str_bg[3], utf_char[16], *next_char, *output;
@@ -673,10 +674,13 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
return 1;
wmove (bar_window->win_bar, *y, *x);
-
- gui_window_set_custom_color_fg_bg (bar_window->win_bar,
- CONFIG_COLOR(bar_window->bar->color_fg),
- CONFIG_COLOR(bar_window->bar->color_bg));
+
+ if (reset_color_before_display)
+ {
+ gui_window_set_custom_color_fg_bg (bar_window->win_bar,
+ CONFIG_COLOR(bar_window->bar->color_fg),
+ CONFIG_COLOR(bar_window->bar->color_bg));
+ }
while (string && string[0])
{
@@ -977,19 +981,25 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
|| (line >= bar_window->scroll_y))
{
if (!gui_bar_window_print_string (bar_window, &x, &y,
- items[line]))
+ items[line], 1))
{
some_data_not_displayed = 1;
}
if (CONFIG_INTEGER(gui_bar_get_option_filling (bar_window->bar)) == GUI_BAR_FILLING_VERTICAL)
{
+ while (x < bar_window->width)
+ {
+ gui_bar_window_print_string (bar_window,
+ &x, &y,
+ " ", 0);
+ }
x = 0;
y++;
}
else
{
gui_bar_window_print_string (bar_window, &x, &y,
- space_with_reinit_color);
+ space_with_reinit_color, 0);
}
}
}
@@ -1081,19 +1091,25 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
|| (line >= bar_window->scroll_y))
{
if (!gui_bar_window_print_string (bar_window, &x, &y,
- items[line]))
+ items[line], 1))
{
some_data_not_displayed = 1;
}
if (CONFIG_INTEGER(gui_bar_get_option_filling (bar_window->bar)) == GUI_BAR_FILLING_VERTICAL)
{
+ while (x < bar_window->width)
+ {
+ gui_bar_window_print_string (bar_window,
+ &x, &y,
+ " ", 0);
+ }
x = 0;
y++;
}
else
{
gui_bar_window_print_string (bar_window, &x, &y,
- space_with_reinit_color);
+ space_with_reinit_color, 0);
}
}
}
@@ -1209,6 +1225,8 @@ gui_bar_draw (struct t_gui_bar *bar)
}
}
}
+
+ bar->bar_refresh_needed = 0;
}
/*