summaryrefslogtreecommitdiff
path: root/src/gui/curses
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-06-13 10:29:57 +0200
committerSebastien Helleu <flashcode@flashtux.org>2012-06-13 10:29:57 +0200
commit907752167fed0d42aaa96ebf8f387755ce2346f5 (patch)
tree3ce73513835fb18558ab9dcc74718204a7df6071 /src/gui/curses
parent529d12c1dbad36227e622edab95ac176a94dd5d5 (diff)
downloadweechat-907752167fed0d42aaa96ebf8f387755ce2346f5.zip
core: fix resize of windows after horizontal split
Diffstat (limited to 'src/gui/curses')
-rw-r--r--src/gui/curses/gui-curses-window.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 4ba665ada..53978735a 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -1556,13 +1556,13 @@ gui_window_auto_resize (struct t_gui_window_tree *tree,
if (tree->split_horizontal)
{
separator = (CONFIG_BOOLEAN(config_look_window_separator_horizontal)) ? 1 : 0;
- size1 = (height * tree->split_pct) / 100;
+ size1 = ((height - separator) * tree->split_pct) / 100;
size2 = height - size1 - separator;
- if (gui_window_auto_resize (tree->child1, x, y + size2 + separator,
- width, size1, simulate) < 0)
+ if (gui_window_auto_resize (tree->child1, x, y + size1 + separator,
+ width, size2, simulate) < 0)
return -1;
if (gui_window_auto_resize (tree->child2, x, y,
- width, size2, simulate) < 0)
+ width, size1, simulate) < 0)
return -1;
}
else
@@ -1660,7 +1660,7 @@ gui_window_split_horizontal (struct t_gui_window *window, int percentage)
separator = (CONFIG_BOOLEAN(config_look_window_separator_horizontal)) ? 1 : 0;
- height1 = (window->win_height * percentage) / 100;
+ height1 = ((window->win_height - separator) * percentage) / 100;
height2 = window->win_height - height1 - separator;
if ((height1 >= 2) && (height2 >= 2)
@@ -1670,13 +1670,13 @@ gui_window_split_horizontal (struct t_gui_window *window, int percentage)
window->win_x,
window->win_y,
window->win_width,
- height2,
+ height1,
100, percentage);
if (new_window)
{
/* reduce old window height (bottom window) */
- window->win_y = new_window->win_y + new_window->win_height + separator;
- window->win_height = height1;
+ window->win_y = new_window->win_y + new_window->win_height;
+ window->win_height = height2;
window->win_height_pct = 100 - percentage;
/* assign same buffer for new window (top window) */