Abstract resize handling by adding a new Htop reaction

This commit is contained in:
Christian Göttsche
2021-08-21 20:48:45 +02:00
committed by BenBE
parent b9e69223d0
commit 68f2bfea61
5 changed files with 11 additions and 5 deletions

View File

@ -388,10 +388,7 @@ Htop_Reaction Action_follow(State* st) {
static Htop_Reaction actionSetup(State* st) {
Action_runSetup(st);
int headerHeight = Header_calculateHeight(st->header);
Panel_move((Panel*)st->mainPanel, 0, headerHeight);
Panel_resize((Panel*)st->mainPanel, COLS, LINES - headerHeight - 1);
return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR | HTOP_RESIZE;
}
static Htop_Reaction actionLsof(State* st) {