Check if the clock is on. (closes #521)

If the clock is on, then change the numlock and capslock state positions.
This commit is contained in:
lolicon0930 2023-06-23 19:32:29 +08:00
parent 42bf929756
commit 0f55de623b
No known key found for this signature in database
GPG Key ID: 084CF5D99A6C4A30
1 changed files with 7 additions and 2 deletions

View File

@ -454,6 +454,11 @@ void draw_lock_state(struct term_buf* buf)
// print text // print text
uint16_t pos_x = buf->width - strlen(lang.numlock); uint16_t pos_x = buf->width - strlen(lang.numlock);
uint16_t pos_y = 1;
if (config.clock == NULL || strlen(config.clock) == 0)
{
pos_y = 0;
}
if (numlock_on) if (numlock_on)
{ {
@ -465,7 +470,7 @@ void draw_lock_state(struct term_buf* buf)
} }
else else
{ {
tb_blit(pos_x, 0, strlen(lang.numlock), 1, numlock); tb_blit(pos_x, pos_y, strlen(lang.numlock), 1, numlock);
free(numlock); free(numlock);
} }
} }
@ -482,7 +487,7 @@ void draw_lock_state(struct term_buf* buf)
} }
else else
{ {
tb_blit(pos_x, 0, strlen(lang.capslock), 1, capslock); tb_blit(pos_x, pos_y, strlen(lang.capslock), 1, capslock);
free(capslock); free(capslock);
} }
} }