diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/curses/gui-curses-window.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index af0a69c91..6d2a96929 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -1109,7 +1109,8 @@ gui_window_vline (WINDOW *window, int x, int y, int height, const char *string) void gui_window_draw_separators (struct t_gui_window *window) { - int separator_horizontal, separator_vertical, x, width; + int separator_horizontal, separator_vertical; + int horiz_overlap, x, width, height; /* remove separators */ if (GUI_WINDOW_OBJECTS(window)->win_separator_horiz) @@ -1130,11 +1131,16 @@ gui_window_draw_separators (struct t_gui_window *window) separator_vertical = (CONFIG_BOOLEAN(config_look_window_separator_vertical) && (window->win_x > gui_bar_root_get_size (NULL, GUI_BAR_POSITION_LEFT))); + /* check if window is right leaf of vertical split */ + horiz_overlap = (window->ptr_tree->parent_node) + && !(window->ptr_tree->parent_node->split_horizontal) + && (window->ptr_tree->parent_node->child2 == window->ptr_tree); + /* create/draw horizontal separator */ if (separator_horizontal) { - x = (separator_vertical) ? window->win_x - 1 : window->win_x; - width = (separator_vertical) ? window->win_width + 1 : window->win_width; + x = (separator_vertical && horiz_overlap) ? window->win_x - 1 : window->win_x; + width = (separator_vertical && horiz_overlap) ? window->win_width + 1 : window->win_width; GUI_WINDOW_OBJECTS(window)->win_separator_horiz = newwin (1, width, window->win_y + window->win_height, @@ -1150,14 +1156,15 @@ gui_window_draw_separators (struct t_gui_window *window) /* create/draw vertical separator */ if (separator_vertical) { - GUI_WINDOW_OBJECTS(window)->win_separator_vertic = newwin (window->win_height, + height = (separator_horizontal && !horiz_overlap) ? window->win_height + 1 : window->win_height; + GUI_WINDOW_OBJECTS(window)->win_separator_vertic = newwin (height, 1, window->win_y, window->win_x - 1); gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_separator_vertic, GUI_COLOR_SEPARATOR); gui_window_vline (GUI_WINDOW_OBJECTS(window)->win_separator_vertic, - 0, 0, window->win_height, + 0, 0, height, CONFIG_STRING(config_look_separator_vertical)); wnoutrefresh (GUI_WINDOW_OBJECTS(window)->win_separator_vertic); } @@ -1811,6 +1818,9 @@ gui_window_split_horizontal (struct t_gui_window *window, int percentage) gui_window_ask_refresh (1); gui_window_switch (new_window); + + /* create & draw separators */ + gui_window_draw_separators (gui_current_window); } } |