mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
[tfman] get everything working on resize
This commit is contained in:
parent
5a205b8410
commit
944184d9b3
@ -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…
x
Reference in New Issue
Block a user