diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-03-04 11:05:05 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-03-04 11:05:05 +0100 |
commit | 6ad62e4021b01061c84398f32f2efd9919923db1 (patch) | |
tree | 6ef3c0830d1164aa0c476aa87a9f6881beefe1ae /src | |
parent | ca51a9780fa315104d67956569dd276e33158dae (diff) | |
download | weechat-6ad62e4021b01061c84398f32f2efd9919923db1.zip |
Fix bugs with cursor and background in bars
Bugs fixed:
- cursor was moving to position (0,0) in bar when refreshing input bar content
- background color stopped before end of line in bars with vertical filling
(like buffers)
- cursor was not displayed when input bar has automatic size and that first line
is filled (on some terminals like konsole or roxterm)
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/curses/gui-curses-bar-window.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c index 8bef5bb8c..881ca5779 100644 --- a/src/gui/curses/gui-curses-bar-window.c +++ b/src/gui/curses/gui-curses-bar-window.c @@ -388,6 +388,16 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window, free (output); *x += size_on_screen; + + if ((*x >= bar_window->width) + && (gui_bar_get_filling (bar_window->bar) != GUI_BAR_FILLING_VERTICAL)) + { + if (*y >= bar_window->height - 1) + return 0; + *x = 0; + (*y)++; + wmove (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, *y, *x); + } } } string = next_char; @@ -617,10 +627,13 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, if (x < bar_window->width) { - gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, - CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]), - CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG])); - wclrtobot (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar); + if (filling == GUI_BAR_FILLING_HORIZONTAL) + { + gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]), + CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG])); + wclrtobot (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar); + } while (x < bar_window->width) { gui_bar_window_print_string (bar_window, @@ -676,7 +689,11 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, if ((!window || (gui_current_window == window)) && (bar_window->cursor_x >= 0) && (bar_window->cursor_y >= 0)) { - wmove (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, 0, 0); + y = bar_window->cursor_y - bar_window->y; + x = bar_window->cursor_x - bar_window->x; + if (x > bar_window->width - 2) + x = bar_window->width - 2; + wmove (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, y, x); wrefresh (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar); move (bar_window->cursor_y, bar_window->cursor_x); } |