summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-02-21 19:51:09 +0100
committerSebastien Helleu <flashcode@flashtux.org>2011-02-21 19:51:09 +0100
commit2ad3a1c326ea0fb06b18f23ca8114fdcb30676d4 (patch)
treee068f28db2aa510794b3fd0adc138ed384d84a8a
parenta63de084cf1758a2696c997b8234f661030ba790 (diff)
downloadweechat-2ad3a1c326ea0fb06b18f23ca8114fdcb30676d4.zip
Auto recalculate values of win_width_pct and win_height_pct when windows are resized
-rw-r--r--src/gui/curses/gui-curses-window.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 0a1f3e75c..7d7cdf41a 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -1420,6 +1420,7 @@ gui_window_auto_resize (struct t_gui_window_tree *tree,
int simulate)
{
int size1, size2;
+ struct t_gui_window_tree *parent;
if (!gui_ok)
return 0;
@@ -1436,6 +1437,22 @@ gui_window_auto_resize (struct t_gui_window_tree *tree,
tree->window->win_y = y;
tree->window->win_width = width;
tree->window->win_height = height;
+ parent = tree->parent_node;
+ if (parent)
+ {
+ if (parent->split_horizontal)
+ {
+ tree->window->win_width_pct = 100;
+ tree->window->win_height_pct = (tree == parent->child1) ?
+ 100 - parent->split_pct : parent->split_pct;
+ }
+ else
+ {
+ tree->window->win_width_pct = (tree == parent->child1) ?
+ parent->split_pct : 100 - parent->split_pct;
+ tree->window->win_height_pct = 100;
+ }
+ }
}
}
else