[tfman] get everything working on resize

pull/2478/head
nick black 3 years ago
parent 5a205b8410
commit 944184d9b3
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -782,6 +782,7 @@ static int
draw_content(struct ncplane* stdn, struct ncplane* p){
pagedom* dom = ncplane_userptr(p);
unsigned wrotetext = 0; // unused by us
docstructure_free(dom->ds);
dom->ds = docstructure_create(stdn);
if(dom->ds == NULL){
return -1;
@ -794,6 +795,7 @@ resize_pman(struct ncplane* pman){
unsigned dimy, dimx;
ncplane_dim_yx(ncplane_parent_const(pman), &dimy, &dimx);
ncplane_resize_simple(pman, dimy - 1, dimx);
ncplane_erase(pman);
struct ncplane* stdn = notcurses_stdplane(ncplane_notcurses(pman));
int r = draw_content(stdn, pman);
ncplane_move_yx(pman, 0, 0);
@ -859,6 +861,7 @@ resize_bar(struct ncplane* bar){
unsigned dimy, dimx;
ncplane_dim_yx(ncplane_parent_const(bar), &dimy, &dimx);
ncplane_resize_simple(bar, 1, dimx);
ncplane_erase(bar);
int r = draw_bar(bar, ncplane_userptr(bar));
ncplane_move_yx(bar, dimy - 1, 0);
return r;

@ -43,7 +43,7 @@ docstructure* docstructure_create(struct ncplane* n){
ncplane_options nopts = {
.rows = ROWS,
.cols = ncplane_dim_x(n) / COLDIV,
.y = ncplane_dim_y(n) - ROWS,
.y = ncplane_dim_y(n) - ROWS - 1,
.x = ncplane_dim_x(n) - (ncplane_dim_x(n) / COLDIV) - 1,
.flags = NCPLANE_OPTION_AUTOGROW, // autogrow to right
};

Loading…
Cancel
Save