Selector: add arrows if there are more options #302

This commit is contained in:
nick black 2020-01-31 19:58:55 -05:00
parent fad612bd2f
commit 45235fc076
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -59,10 +59,12 @@ ncselector_draw(ncselector* n){
n->ncp->channels = n->footchannels; n->ncp->channels = n->footchannels;
ncplane_putstr_yx(n->ncp, dimy - 1, xloc, n->footer); ncplane_putstr_yx(n->ncp, dimy - 1, xloc, n->footer);
} }
n->ncp->channels = n->descchannels;
ncplane_putegc_yx(n->ncp, ++yoff, bodywidth - (n->longdesc + 3), "", NULL);
unsigned printidx = n->startdisp; unsigned printidx = n->startdisp;
int bodyoffset = dimx - bodywidth + 2; int bodyoffset = dimx - bodywidth + 2;
unsigned printed = 0; unsigned printed = 0;
for(yoff += 2 ; yoff < dimy - 2 ; ++yoff){ for(yoff += 1 ; yoff < dimy - 2 ; ++yoff){
if(n->maxdisplay && printed == n->maxdisplay){ if(n->maxdisplay && printed == n->maxdisplay){
break; break;
} }
@ -82,6 +84,8 @@ ncselector_draw(ncselector* n){
} }
++printed; ++printed;
} }
n->ncp->channels = n->descchannels;
ncplane_putegc_yx(n->ncp, yoff, bodywidth - (n->longdesc + 3), "", NULL);
return notcurses_render(n->ncp->nc); return notcurses_render(n->ncp->nc);
} }