diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2008-12-06 17:02:27 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-12-06 17:02:27 +0000 |
commit | 04a028d8c9df9a90bc2c3fe1a15b661a74ba8005 (patch) | |
tree | 922e3b2bac7514b84e93b3541aa8fef687155f0e /src/fe-text/mainwindows.c | |
parent | fe9b63ef654e30ee7dc6b90f5fd94933dbc31a1c (diff) | |
download | irssi-04a028d8c9df9a90bc2c3fe1a15b661a74ba8005.zip |
Simplify and remove dead code, MAIN_WINDOW_TEXT_HEIGHT(rec) >= WINDOW_MIN_SIZE
always holds.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4948 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/mainwindows.c')
-rw-r--r-- | src/fe-text/mainwindows.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index c8b3a3a0..55c87e5c 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -389,7 +389,7 @@ static void mainwindows_resize_smaller(int xdiff, int ydiff) rec = tmp->data; space = MAIN_WINDOW_TEXT_HEIGHT(rec)-WINDOW_MIN_SIZE; - if (space <= 0) { + if (space == 0) { mainwindow_resize(rec, xdiff, 0); rec->first_line += ydiff; @@ -398,7 +398,6 @@ static void mainwindows_resize_smaller(int xdiff, int ydiff) continue; } - if (space <= 0) space = 1; if (space > -ydiff) space = -ydiff; rec->last_line += ydiff; ydiff += space; @@ -428,7 +427,7 @@ static void mainwindows_resize_bigger(int xdiff, int ydiff) MAIN_WINDOW_REC *rec = tmp->data; space = MAIN_WINDOW_TEXT_HEIGHT(rec)-WINDOW_MIN_SIZE; - if (ydiff == 0 || (space >= 0 && tmp->next != NULL)) { + if (ydiff == 0 || tmp->next != NULL) { mainwindow_resize(rec, xdiff, 0); if (moved > 0) { rec->first_line += moved; @@ -438,14 +437,8 @@ static void mainwindows_resize_bigger(int xdiff, int ydiff) continue; } - if (space < 0 && tmp->next != NULL) { - /* space below minimum */ - space = -space; - if (space > ydiff) space = ydiff; - } else { - /* lowest window - give all the extra space for it */ - space = ydiff; - } + /* lowest window - give all the extra space for it */ + space = ydiff; ydiff -= space; rec->first_line += moved; moved += space; |