mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 07:16:37 +02:00
Use or '\r' in bar items to force new line with horizontal filling
This commit is contained in:
@@ -513,22 +513,14 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
|
||||
{
|
||||
some_data_not_displayed = 1;
|
||||
}
|
||||
if (filling != GUI_BAR_FILLING_HORIZONTAL)
|
||||
while (x < bar_window->width)
|
||||
{
|
||||
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, 0);
|
||||
gui_bar_window_print_string (bar_window,
|
||||
&x, &y,
|
||||
" ", 0);
|
||||
}
|
||||
x = 0;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
if ((bar_window->cursor_x < 0) && (bar_window->cursor_y < 0)
|
||||
|
||||
@@ -436,7 +436,7 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window,
|
||||
{
|
||||
enum t_gui_bar_filling filling;
|
||||
char *ptr_content, *content, reinit_color[32], reinit_color_space[32];
|
||||
char *item_value, ****split_items, **linear_items;
|
||||
char *item_value, *item_value2, ****split_items, **linear_items;
|
||||
int index_content, content_length, i, sub, j, k, index;
|
||||
int length_reinit_color, length_reinit_color_space;
|
||||
int length, max_length, max_length_screen, total_items, columns, lines;
|
||||
@@ -480,6 +480,16 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window,
|
||||
{
|
||||
item_value = string_replace (ptr_content, "\n",
|
||||
reinit_color_space);
|
||||
if (item_value)
|
||||
{
|
||||
item_value2 = string_replace (item_value,
|
||||
"\r", "\n");
|
||||
if (item_value2)
|
||||
{
|
||||
free (item_value);
|
||||
item_value = item_value2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
item_value = NULL;
|
||||
|
||||
Reference in New Issue
Block a user