mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
Make width of the scanning screen dynamic based on terminal width
http://dev.yorhel.nl/ncdu/bug/13
This commit is contained in:
parent
8a55c05e7d
commit
9c9d466752
1 changed files with 5 additions and 4 deletions
|
|
@ -299,20 +299,21 @@ static void calc_draw_progress() {
|
|||
static char antext[15] = "Calculating...";
|
||||
char ani[15];
|
||||
int i;
|
||||
int width = wincols-5;
|
||||
|
||||
nccreate(10, 60, !orig ? "Calculating..." : "Recalculating...");
|
||||
nccreate(10, width, !orig ? "Calculating..." : "Recalculating...");
|
||||
|
||||
ncprint(2, 2, "Total items: %-8d size: %s",
|
||||
root->items, formatsize(root->size));
|
||||
ncprint(3, 2, "Current dir: %s", cropstr(curpath, 43));
|
||||
ncaddstr(8, 43, "Press q to quit");
|
||||
ncprint(3, 2, "Current dir: %s", cropstr(curpath, width-17));
|
||||
ncaddstr(8, width-17, "Press q to quit");
|
||||
|
||||
/* show warning if we couldn't open a dir */
|
||||
if(lasterr[0] != '\0') {
|
||||
attron(A_BOLD);
|
||||
ncaddstr(5, 2, "Warning:");
|
||||
attroff(A_BOLD);
|
||||
ncprint(5, 11, "could not open %-32s", cropstr(lasterr, 32));
|
||||
ncprint(5, 11, "could not open %-32s", cropstr(lasterr, width-28));
|
||||
ncaddstr(6, 3, "some directory sizes may not be correct");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue