mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-08 01:10:23 +00:00
demo: don't print 4th version component unless non-0
This commit is contained in:
parent
935ae0378b
commit
ab04b607b8
@ -103,9 +103,16 @@ int intro(struct notcurses* nc){
|
|||||||
ncplane_set_fg_rgb(ncp, 0xff, 0xff, 0xff);
|
ncplane_set_fg_rgb(ncp, 0xff, 0xff, 0xff);
|
||||||
int major, minor, patch, tweak;
|
int major, minor, patch, tweak;
|
||||||
notcurses_version_components(&major, &minor, &patch, &tweak);
|
notcurses_version_components(&major, &minor, &patch, &tweak);
|
||||||
if(ncplane_printf_aligned(ncp, rows / 2, NCALIGN_CENTER, "notcurses %d.%d.%d.%d. press 'q' to quit.",
|
if(tweak){
|
||||||
major, minor, patch, tweak) < 0){
|
if(ncplane_printf_aligned(ncp, rows / 2, NCALIGN_CENTER, "notcurses %d.%d.%d.%d. press 'q' to quit.",
|
||||||
return -1;
|
major, minor, patch, tweak) < 0){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(ncplane_printf_aligned(ncp, rows / 2, NCALIGN_CENTER, "notcurses %d.%d.%d. press 'q' to quit.",
|
||||||
|
major, minor, patch) < 0){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ncplane_styles_off(ncp, NCSTYLE_BOLD);
|
ncplane_styles_off(ncp, NCSTYLE_BOLD);
|
||||||
const wchar_t wstr[] = L"▏▁ ▂ ▃ ▄ ▅ ▆ ▇ █ █ ▇ ▆ ▅ ▄ ▃ ▂ ▁▕";
|
const wchar_t wstr[] = L"▏▁ ▂ ▃ ▄ ▅ ▆ ▇ █ █ ▇ ▆ ▅ ▄ ▃ ▂ ▁▕";
|
||||||
|
Loading…
Reference in New Issue
Block a user