diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2019-10-06 19:07:25 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2019-10-06 19:07:25 +0200 |
commit | f2551b8403889041bd92ee5c1a6dd711c430f4e1 (patch) | |
tree | 2a44d8db5d3b4d23f01aff0a96c9cc0eabf9897c /src | |
parent | 98d9dc1a039bda4f28d7845349796d60c4cb2216 (diff) | |
parent | 49ce989de6fec2d157ff49eab777313e6c250b6c (diff) | |
download | weechat-f2551b8403889041bd92ee5c1a6dd711c430f4e1.zip |
Merge remote-tracking branch 'origin/pr/630'
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/curses/gui-curses-window.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index 57b779ca6..47800597d 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -1115,7 +1115,9 @@ 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; + struct t_gui_window_tree *ptr_tree, *ptr_child; /* remove separators */ if (GUI_WINDOW_OBJECTS(window)->win_separator_horiz) @@ -1136,11 +1138,30 @@ 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 horizontal separator must overlap in lower left corner */ + horiz_overlap = 0; + ptr_child = window->ptr_tree; + ptr_tree = ptr_child->parent_node; + while (ptr_tree) + { + /* is right/top child */ + if (ptr_tree->child2 == ptr_child) + { + /* horizontal overlap is needed when window is right in vertical split */ + /* horizontal overlap is not needed when window is top in horizontal split */ + horiz_overlap = !ptr_tree->split_horizontal; + break; + } + + ptr_child = ptr_child->parent_node; + ptr_tree = ptr_tree->parent_node; + } + /* 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, @@ -1156,14 +1177,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); } @@ -1817,6 +1839,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); } } |