1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +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
+3 -1
View File
@@ -1,12 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.6-dev, 2011-07-30
v0.3.6-dev, 2011-08-02
Version 0.3.6 (under dev!)
--------------------------
* core: stop horizontal bar scroll at the end of content (for bars with
horizontal filling) (bug #27908)
* core: fix crash when building hashtable string with keys and values
* core: add number in windows (add optional argument "-window" so some actions
for command /window)
+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)
{