1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 17:23:15 +02:00

core: stop horizontal bar scroll at the end of content (for bars with horizontal filling) (bug #27908)

This commit is contained in:
Sebastien Helleu
2011-08-02 12:35:10 +02:00
parent 6be3b3d064
commit 7ef99737d0
2 changed files with 15 additions and 1 deletions
+12
View File
@@ -435,6 +435,18 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
content = gui_bar_window_content_get_with_filling (bar_window, window);
if (content)
{
if ((filling == GUI_BAR_FILLING_HORIZONTAL)
&& (bar_window->scroll_x > 0))
{
length_on_screen = gui_chat_strlen_screen (content);
if (bar_window->scroll_x > length_on_screen - bar_window->width)
{
bar_window->scroll_x = length_on_screen - bar_window->width;
if (bar_window->scroll_x < 0)
bar_window->scroll_x = 0;
}
}
items = string_split (content, "\n", 0, 0, &items_count);
if (items_count == 0)
{