nctree: implement NCKEY_END

pull/1403/head
nick black 4 years ago
parent 64634143ca
commit e2885b5a68
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -30,6 +30,7 @@ visualize(struct notcurses* nc, struct ncvisual* ncv){
int scalex, scaley, truey, truex;
ncvisual_geom(nc, ncv, &vopts, &truey, &truex, &scaley, &scalex);
vopts.x = (ncplane_dim_x(notcurses_stdplane(nc)) - truex / scalex) / 2;
vopts.y = (ncplane_dim_y(notcurses_stdplane(nc)) - truey / scaley) / 2;
//fprintf(stderr, "X: %d truex: %d sclaex: %d\n", vopts.x, truex, scalex);
ncplane_erase(stdn);
// if we're about to blit pixel graphics, render the screen as empty, so

@ -67,6 +67,18 @@ dup_tree_items(nctree_int_item* fill, const nctree_item* items, unsigned count,
return 0;
}
static void
goto_last_item(nctree* n){
void* prev = NULL;
void* r;
while((r = nctree_next(n))){
if(r == prev){
return;
}
prev = r;
}
}
static void
goto_first_item(nctree* n){
n->currentpath[0] = 0;
@ -438,7 +450,7 @@ bool nctree_offer_input(nctree* n, const ncinput* ni){
goto_first_item(n);
return true;
}else if(ni->id == NCKEY_END){
nctree_next(n); // more FIXME
goto_last_item(n);
return true;
}
// FIXME implement left, right, +, - (expand/collapse)

Loading…
Cancel
Save