summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-08-08 14:43:14 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-08-08 14:43:14 +0000
commita99458ebe5c40bf2c2b70504402326daf0eba0d2 (patch)
treeb318be5d565de64290c88cb8bc1c1d181afdd283 /src
parentf124f07a4e9535bdaf4a7dd4674711f9bee6d487 (diff)
downloadirssi-a99458ebe5c40bf2c2b70504402326daf0eba0d2.zip
/WINDOW BALANCE didn't work properly when topicbar was off. Added a few
comments to mainwindows.h git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1716 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/mainwindows.c8
-rw-r--r--src/fe-text/mainwindows.h5
2 files changed, 7 insertions, 6 deletions
diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c
index 26a6a6dd..3b8a4aa1 100644
--- a/src/fe-text/mainwindows.c
+++ b/src/fe-text/mainwindows.c
@@ -616,13 +616,13 @@ static void cmd_window_balance(void)
bigger_units = avail_size%windows;
sorted = mainwindows_get_sorted(FALSE);
- last_line = 0;
+ last_line = reserved_up;
for (tmp = sorted; tmp != NULL; tmp = tmp->next) {
MAIN_WINDOW_REC *rec = tmp->data;
old_size = rec->height;
- rec->first_line = last_line+1;
- rec->last_line = rec->first_line-1 + unit_size -
+ rec->first_line = last_line;
+ rec->last_line = rec->first_line + unit_size-1 -
rec->statusbar_lines;
rec->height = rec->last_line-rec->first_line+1;
@@ -630,7 +630,7 @@ static void cmd_window_balance(void)
rec->last_line++;
bigger_units--;
}
- last_line = rec->last_line + rec->statusbar_lines;
+ last_line = rec->last_line+1 + rec->statusbar_lines;
mainwindow_resize(rec, 0, rec->height-old_size);
}
diff --git a/src/fe-text/mainwindows.h b/src/fe-text/mainwindows.h
index 2c45eb54..754cd011 100644
--- a/src/fe-text/mainwindows.h
+++ b/src/fe-text/mainwindows.h
@@ -12,9 +12,10 @@ typedef struct {
SCREEN_WINDOW *screen_win;
int sticky_windows; /* number of sticky windows */
- int first_line, last_line, width, height;
+ int first_line, last_line; /* first/last line used by this window (0..x), not including statusbar */
+ int width, height; /* width/height of the window, not including statusbar */
- int statusbar_lines;
+ int statusbar_lines; /* number of lines the statusbar takes below the window */
void *statusbar;
void *statusbar_window_item;
} MAIN_WINDOW_REC;