ncneofetch: bring neologo_present() into csi mode

pull/2056/head
nick black 3 years ago committed by nick black
parent 367d7b79da
commit 636101578c

@ -519,20 +519,22 @@ neologo_present(struct notcurses* nc, const char* nlogo){
maxlinelen = collen; maxlinelen = collen;
} }
} }
const int leftpad = (ncdirect_dim_x(nc) - maxlinelen) / 2; int dimy, dimx;
struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx);
const int leftpad = (dimx - maxlinelen) / 2;
for(int i = 0 ; i < linecount ; ++i){ for(int i = 0 ; i < linecount ; ++i){
printf("%*.*s%s", leftpad, leftpad, "", lines[i]); printf("%*.*s%s", leftpad, leftpad, "", lines[i]);
free(lines[i]); free(lines[i]);
} }
free(lines); free(lines);
ncdirect_set_fg_default(nc); ncplane_set_fg_default(n);
ncdirect_on_styles(nc, NCSTYLE_BOLD | NCSTYLE_ITALIC); ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_ITALIC);
if(ncdirect_canopen_images(nc)){ if(notcurses_canopen_images(nc)){
ncdirect_printf_aligned(nc, -1, NCALIGN_CENTER, "(no image file is known for your distro)"); ncplane_putstr_aligned(n, -1, NCALIGN_CENTER, "(no image file is known for your distro)");
}else{ }else{
ncdirect_printf_aligned(nc, -1, NCALIGN_CENTER, "(notcurses was compiled without image support)"); ncplane_putstr_aligned(n, -1, NCALIGN_CENTER, "(notcurses was compiled without image support)");
} }
ncdirect_off_styles(nc, NCSTYLE_BOLD | NCSTYLE_ITALIC); ncplane_off_styles(n, NCSTYLE_BOLD | NCSTYLE_ITALIC);
return 0; return 0;
} }

Loading…
Cancel
Save