flowtop: Improve and unify up/down scrolling
commit83f11c231626f79433a021c526ffa1ac7521ae36
authorVadim Kochan <vadim4j@gmail.com>
Sat, 27 May 2017 15:30:08 +0000 (27 18:30 +0300)
committerTobias Klauser <tklauser@distanz.ch>
Tue, 30 May 2017 07:26:30 +0000 (30 09:26 +0200)
tree72a3e0cfb3efd9e34455c8ad5d670a2e08900112
parent90b9483c806f0571988581c1712c7ca236c4a38c
flowtop: Improve and unify up/down scrolling

Move scrolling logic to the ui.c module, it requires to have
some data iteration provided in flowtop.c and delegated to ui.c part.

So approach is that now flowtop provides 2 additional callbacks for:

    1) Iterate over flows/procs list
    2) Draw flow/proc on each iteration which is controlled from ui.c

it allows to unify scrolling logic and delegate it to the ui.c, in the
future it should allow to easy handle press event on selected row and
drow some additional information, or draw a cursor line per selected
row.

Also fixed case when down scrolling was bigger that printed rows, not
it is handled by ui part.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
flowtop.c
ui.c
ui.h