summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-08-02 12:35:10 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-08-02 12:35:10 +0200
commit7ef99737d07820e60f03f094a8d40de1469cc8b8 (patch)
tree400d249dbf4eeea8ec2e00c565dbab862b250fb2 /src/gui
parent6be3b3d0649c41ef70df46875bde821a5fd4f62e (diff)
downloadweechat-7ef99737d07820e60f03f094a8d40de1469cc8b8.zip
core: stop horizontal bar scroll at the end of content (for bars with horizontal filling) (bug #27908)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/curses/gui-curses-bar-window.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c
index ced409c64..aee425f12 100644
--- a/src/gui/curses/gui-curses-bar-window.c
+++ b/src/gui/curses/gui-curses-bar-window.c
@@ -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)
{