mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Merge pull request #534 from Explorer09/issue-532
Change scrolling behavior to make it more similar to other applications.
This commit is contained in:
commit
b269eb24b0
5
Panel.c
5
Panel.c
@ -407,12 +407,13 @@ bool Panel_onKey(Panel* this, int key) {
|
||||
break;
|
||||
case KEY_PPAGE:
|
||||
this->selected -= (this->h - 1);
|
||||
this->scrollV -= (this->h - 1);
|
||||
this->scrollV = MAX(0, this->scrollV - this->h + 1);
|
||||
this->needsRedraw = true;
|
||||
break;
|
||||
case KEY_NPAGE:
|
||||
this->selected += (this->h - 1);
|
||||
this->scrollV = MIN(MAX(0, Vector_size(this->items) - this->h), this->selected - this->h);
|
||||
this->scrollV = MAX(0, MIN(Vector_size(this->items) - this->h,
|
||||
this->scrollV + this->h - 1));
|
||||
this->needsRedraw = true;
|
||||
break;
|
||||
case KEY_WHEELUP:
|
||||
|
Loading…
Reference in New Issue
Block a user