Selector: properly place scroll arrows #388

When the selector body was being sized by the header
or footer (as opposed to option+desc length), our scroll
arrows are misplaced. They now land properly. Mouse
clicks are properly placed now, and screenshots have been
updated in the guide.
pull/396/head
nick black 4 years ago
parent c87a9ed5dd
commit e6bbcd2e70
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -77,14 +77,16 @@ ncselector_draw(ncselector* n){
for(int i = xoff + 1 ; i < dimx - 1 ; ++i){
ncplane_putc(n->ncp, &n->background);
}
const int bodyoffset = dimx - bodywidth + 2;
if(n->maxdisplay && n->maxdisplay < n->itemcount){
n->ncp->channels = n->descchannels;
ncplane_putegc_yx(n->ncp, yoff, bodywidth - (n->longdesc + 3) + xoff, "", NULL);
n->arrowx = bodyoffset + n->longop;
ncplane_putegc_yx(n->ncp, yoff, n->arrowx, "", NULL);
}else{
n->arrowx = -1;
}
n->arrowx = bodywidth - (n->longdesc + 3) + xoff;
n->uarrowy = yoff;
unsigned printidx = n->startdisp;
int bodyoffset = dimx - bodywidth + 2;
unsigned printed = 0;
for(yoff += 1 ; yoff < dimy - 2 ; ++yoff){
if(n->maxdisplay && printed == n->maxdisplay){
@ -116,7 +118,7 @@ ncselector_draw(ncselector* n){
}
if(n->maxdisplay && n->maxdisplay < n->itemcount){
n->ncp->channels = n->descchannels;
ncplane_putegc_yx(n->ncp, yoff, bodywidth - (n->longdesc + 3) + xoff, "", NULL);
ncplane_putegc_yx(n->ncp, yoff, n->arrowx, "", NULL);
}
n->darrowy = yoff;
return notcurses_render(n->ncp->nc);

Loading…
Cancel
Save