Update src/main.c

Signed-off-by: 0xf8 <0xf8.dev@proton.me>
This commit is contained in:
0xf8 2023-02-25 12:06:53 -05:00
parent 88435ebe15
commit 2bb0d405b8
Signed by: 0xf8
GPG Key ID: 446580D758689584
1 changed files with 5 additions and 13 deletions

View File

@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with thi
#define true 1
#define false 0
enum {SECS_TO_SLEEP = 0, NSEC_TO_SLEEP = 40000000};
enum {SECS_TO_SLEEP = 0, NSEC_TO_SLEEP = 250000000};
struct notcurses *_nc;
void cleanup() {
@ -129,7 +129,6 @@ void *notcurses_thread(void *_) {
int main(int argc, char **argv) {
// tests
struct timespec remaining, request = {SECS_TO_SLEEP, NSEC_TO_SLEEP};
setlocale(LC_ALL, "C");
@ -180,10 +179,10 @@ int main(int argc, char **argv) {
ncplane_putchar_yx(notcurses_stdplane(nc), midr + 0, midc, '|');
ncplane_putchar_yx(notcurses_stdplane(nc), midr + 1, midc, '|');
drawbignumber(bn_houru, sec, midc - 19, midr - 2, notcurses_stdplane(nc));
drawbignumber(bn_hourl, sec, midc - 9, midr - 2, notcurses_stdplane(nc));
drawbignumber(bn_minu, sec, midc + 2, midr - 2, notcurses_stdplane(nc));
drawbignumber(bn_minl, sec, midc + 12, midr - 2, notcurses_stdplane(nc));
drawbignumber(bn_houru, sec, midc - 20, midr - 2, notcurses_stdplane(nc));
drawbignumber(bn_hourl, sec, midc - 10, midr - 2, notcurses_stdplane(nc));
drawbignumber(bn_minu, sec, midc + 3, midr - 2, notcurses_stdplane(nc));
drawbignumber(bn_minl, sec, midc + 13, midr - 2, notcurses_stdplane(nc));
free(bn_houru);
free(bn_hourl);
free(bn_minu);
@ -233,20 +232,13 @@ void drawbignumber(struct bignumber_t *bn, int sec, int startx, int starty, stru
if (currentSec) ncplane_set_bg_rgb(plane, 0xFFFFFF), ncplane_set_fg_rgb(plane, 0x333333), ncplane_set_bg_alpha(plane, NCALPHA_OPAQUE);
ncplane_set_styles(plane, ncplane_styles(plane));
ncplane_putstr_yx(plane, starty + y, startx + (x * 3), padded_num->s);
ncplane_set_styles(plane, 0x0000);
ncplane_set_bg_rgb(plane, bg);
ncplane_set_fg_rgb(plane, fg);
ncplane_set_bg_alpha(plane, NCALPHA_TRANSPARENT);
ncplane_set_fg_alpha(plane, NCALPHA_OPAQUE);
// attroff(A_BOLD);
// attroff(A_REVERSE);
// attroff(COLOR_PAIR(1));
// attroff(COLOR_PAIR(2));
free_string(padded_num);
}