mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-20 03:25:47 +00:00
panelreel: initial tablet count based on height
This commit is contained in:
parent
930968f31a
commit
6cb945f3d5
@ -293,14 +293,15 @@ panelreel_demo_core(struct notcurses* nc, int efd, tabletctx** tctxs){
|
|||||||
ncplane_printf(w, "a, b, c create tablets, DEL deletes.");
|
ncplane_printf(w, "a, b, c create tablets, DEL deletes.");
|
||||||
ncplane_styles_off(w, CELL_STYLE_BOLD | CELL_STYLE_ITALIC);
|
ncplane_styles_off(w, CELL_STYLE_BOLD | CELL_STYLE_ITALIC);
|
||||||
// FIXME clrtoeol();
|
// FIXME clrtoeol();
|
||||||
unsigned id = 0;
|
|
||||||
struct timespec deadline;
|
struct timespec deadline;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &deadline);
|
clock_gettime(CLOCK_MONOTONIC, &deadline);
|
||||||
ns_to_timespec((timespec_to_ns(&demodelay) * 5) + timespec_to_ns(&deadline),
|
ns_to_timespec((timespec_to_ns(&demodelay) * 5) + timespec_to_ns(&deadline),
|
||||||
&deadline);
|
&deadline);
|
||||||
|
unsigned id = 0;
|
||||||
struct tabletctx* newtablet;
|
struct tabletctx* newtablet;
|
||||||
while(id < INITIAL_TABLET_COUNT){
|
int dimy = ncplane_dim_y(w);
|
||||||
|
// Make an initial number of tablets suitable for the screen's height
|
||||||
|
while(id < dimy / 8u){
|
||||||
newtablet = new_tabletctx(pr, &id);
|
newtablet = new_tabletctx(pr, &id);
|
||||||
if(newtablet == NULL){
|
if(newtablet == NULL){
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user