mirror of https://github.com/fairyglade/ly.git
rename clock to bigclock
This commit is contained in:
parent
c4a3c91a76
commit
4f348f7a4a
|
|
@ -161,9 +161,9 @@ void config_load(const char *cfg_path)
|
|||
{"animation", &config.animation, config_handle_u8},
|
||||
{"asterisk", &config.asterisk, config_handle_char},
|
||||
{"bg", &config.bg, config_handle_u8},
|
||||
{"bigclock", &config.bigclock, config_handle_bool},
|
||||
{"blank_box", &config.blank_box, config_handle_bool},
|
||||
{"blank_password", &config.blank_password, config_handle_bool},
|
||||
{"clock", &config.clock, config_handle_bool},
|
||||
{"console_dev", &config.console_dev, config_handle_str},
|
||||
{"default_input", &config.default_input, config_handle_u8},
|
||||
{"fg", &config.fg, config_handle_u8},
|
||||
|
|
@ -270,6 +270,7 @@ void config_defaults()
|
|||
config.animation = 0;
|
||||
config.asterisk = '*';
|
||||
config.bg = 0;
|
||||
config.bigclock = false;
|
||||
config.blank_box = true;
|
||||
config.blank_password = false;
|
||||
config.console_dev = strdup("/dev/console");
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ struct config
|
|||
uint8_t animation;
|
||||
char asterisk;
|
||||
uint8_t bg;
|
||||
bool bigclock;
|
||||
bool blank_box;
|
||||
bool blank_password;
|
||||
bool clock;
|
||||
char* console_dev;
|
||||
uint8_t default_input;
|
||||
uint8_t fg;
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ void draw_box(struct term_buf* buf)
|
|||
}
|
||||
}
|
||||
|
||||
char* get_clock_string()
|
||||
char* bigclock_str()
|
||||
{
|
||||
time_t timer;
|
||||
char* buffer = malloc(6);
|
||||
|
|
@ -231,15 +231,15 @@ void alpha_blit(struct tb_cell* buf, uint16_t x, uint16_t y, uint16_t w, uint16_
|
|||
}
|
||||
}
|
||||
|
||||
void draw_clock(struct term_buf* buf)
|
||||
void draw_bigclock(struct term_buf* buf)
|
||||
{
|
||||
if (!config.clock)
|
||||
if (!config.bigclock)
|
||||
return;
|
||||
|
||||
int xo = buf->box_x + buf->box_width / 2 - (5 * (CLOCK_W + 1)) / 2;
|
||||
int yo = buf->box_y - CLOCK_H - 2;
|
||||
|
||||
char* clockstr = get_clock_string();
|
||||
char* clockstr = bigclock_str();
|
||||
struct tb_cell* clockcell;
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
|
|
|
|||
|
|
@ -86,6 +86,6 @@ void animate_init(struct term_buf* buf);
|
|||
void animate(struct term_buf* buf);
|
||||
bool cascade(struct term_buf* buf, uint8_t* fails);
|
||||
|
||||
void draw_clock(struct term_buf *buf);
|
||||
void draw_bigclock(struct term_buf *buf);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ int main(int argc, char** argv)
|
|||
(*input_handles[active_input])(input_structs[active_input], NULL);
|
||||
tb_clear();
|
||||
animate(&buf);
|
||||
draw_clock(&buf);
|
||||
draw_bigclock(&buf);
|
||||
draw_box(&buf);
|
||||
draw_labels(&buf);
|
||||
if(!config.hide_f1_commands)
|
||||
|
|
@ -211,7 +211,7 @@ int main(int argc, char** argv)
|
|||
|
||||
if (config.animate) {
|
||||
error = tb_peek_event(&event, config.min_refresh_delta);
|
||||
} else if (config.clock) {
|
||||
} else if (config.bigclock) {
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
error = tb_peek_event(&event, (60 - tv.tv_sec % 60) * 1000 - tv.tv_usec / 1000);
|
||||
|
|
|
|||
Loading…
Reference in New Issue