Skip to content

Commit

Permalink
poc/menu: kill brown-bagger, add backgrounds #383
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Feb 23, 2020
1 parent 35b8615 commit 9a64906
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/release-checklist.md
Expand Up @@ -13,7 +13,7 @@
* Repack DFSG-safe tarball, upload to github
* download github-spun tarball
* remove nonfree multimedia:
* rm data/chun* data/[deflmPw]* src/demo/jungle.c
* rm data/chun* data/[adeflmPw]* src/demo/jungle.c
* `tar -cJf ../v$VERSION.dfsg.tar.xz -C.. notcurses-$VERSION`
* upload to github
* Build new Debian package
Expand Down
35 changes: 31 additions & 4 deletions src/poc/menu.c
Expand Up @@ -58,6 +58,7 @@ run_menu(struct notcurses* nc, struct ncmenu* ncm){
notcurses_render(nc);
}
ncmenu_destroy(ncm);
return 0;

err:
ncplane_destroy(selplane);
Expand Down Expand Up @@ -109,10 +110,22 @@ int main(void){
if(top == NULL){
goto err;
}

struct ncplane* n = notcurses_stdplane(nc);
int dimy, dimx;
ncplane_dim_yx(n, &dimy, &dimx);
struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx);

int averr;

struct ncvisual* ncv = ncplane_visual_open(n, "../data/ebolavirus_wide-0723bc3f01c644976b4df7e146a1d795aaf9d55e.jpg", &averr);
if(!ncv){
goto err;
}
if(!ncvisual_decode(ncv, &averr)){
goto err;
}
if(ncvisual_render(ncv, 0, 0, 0, 0)){
goto err;
}

uint64_t channels = 0;
channels_set_fg(&channels, 0x88aa00);
channels_set_bg(&channels, 0x000088);
Expand All @@ -128,6 +141,19 @@ int main(void){
run_menu(nc, top);

ncplane_erase(n);
ncvisual_destroy(ncv);

ncv = ncplane_visual_open(n, "../data/aidsrobots.jpeg", &averr);
if(!ncv){
goto err;
}
if(!ncvisual_decode(ncv, &averr)){
goto err;
}
if(ncvisual_render(ncv, 0, 0, 0, 0)){
goto err;
}

mopts.bottom = true;
struct ncmenu* bottom = ncmenu_create(nc, &mopts);
if(bottom == NULL){
Expand All @@ -136,8 +162,9 @@ int main(void){
if(ncplane_putstr_aligned(n, 0, NCALIGN_RIGHT, " -=+ menu poc. press q to exit +=- ") < 0){
return EXIT_FAILURE;
}
run_menu(nc, top);
run_menu(nc, bottom);

ncvisual_destroy(ncv);
if(notcurses_stop(nc)){
return EXIT_FAILURE;
}
Expand Down

0 comments on commit 9a64906

Please sign in to comment.