diff options
author | Simmo Saan <simmo.saan@gmail.com> | 2015-12-21 17:41:38 +0200 |
---|---|---|
committer | Simmo Saan <simmo.saan@gmail.com> | 2015-12-21 17:41:38 +0200 |
commit | 9cc68b641b098fa251f449bf5c1cac1b94640214 (patch) | |
tree | f08736b4089b5bdacab717576dd868e0cd0821db /src/gui | |
parent | cb23d0166a8f65221d1033a2d2490d5448cc30d9 (diff) | |
download | weechat-9cc68b641b098fa251f449bf5c1cac1b94640214.zip |
gui: fix window separators not respecting window splits
Diffstat (limited to 'src/gui')
-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); } } |